File size: 1,123 Bytes
85bd401 b132285 85bd401 b132285 85bd401 b132285 85bd401 b132285 85bd401 b132285 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import gradio as gr
import sambanova_gradio
gr.load("Qwen2.5-Coder-32B-Instruct", src=sambanova_gradio.registry).launch()
# import os
# import gradio as gr
# import openai
# # Set up the OpenAI client with the Sambanova API
# client = openai.OpenAI(
# api_key=os.environ.get("SAMBANOVA_API_KEY"),
# base_url="https://api.sambanova.ai/v1",
# )
# def generate_text(prompt):
# response = client.chat.completions.create(
# model='Qwen2.5-Coder-32B-Instruct',
# messages=[
# {"role": "system", "content": "You are a helpful assistant"},
# {"role": "user", "content": prompt}
# ],
# temperature=0,
# max_tokens=8192
# )
# return response.choices[0].message.content
# # Create the Gradio interface
# iface = gr.Interface(
# fn=generate_text,
# inputs=gr.inputs.Textbox(lines=2, placeholder="Enter your prompt here..."),
# outputs="text",
# title="Qwen2.5-Coder-32B-Instruct Chatbot",
# description="Enter a prompt and get a response from the Qwen2.5-Coder-32B-Instruct model."
# )
# # Launch the interface
# iface.launch() |