|
|
import gradio as gr |
|
|
|
|
|
|
|
|
model = gr.load( |
|
|
"models/dphn/Dolphin-Mistral-24B-Venice-Edition", |
|
|
provider="featherless-ai", |
|
|
) |
|
|
|
|
|
def chat_with_model(prompt): |
|
|
try: |
|
|
|
|
|
|
|
|
response = model(prompt) |
|
|
return response |
|
|
except Exception as e: |
|
|
return f"⚠️ Error: {str(e)}" |
|
|
|
|
|
|
|
|
with gr.Blocks(title="Dolphin Mistral Chatbot") as demo: |
|
|
gr.Markdown("### 🐬 Dolphin Mistral 24B Chatbot") |
|
|
|
|
|
with gr.Row(): |
|
|
with gr.Column(scale=3): |
|
|
user_input = gr.Textbox(label="Your Message", placeholder="Type 'hi'", lines=3) |
|
|
submit_btn = gr.Button("Send") |
|
|
with gr.Column(scale=2): |
|
|
output_box = gr.Textbox(label="AI Response", lines=10) |
|
|
|
|
|
submit_btn.click(chat_with_model, inputs=user_input, outputs=output_box) |
|
|
|
|
|
demo.launch() |
|
|
|