File size: 970 Bytes
fb85f1c
 
74b016b
e128c13
 
 
 
 
 
74b016b
f71ca7d
 
 
 
74b016b
 
e128c13
74b016b
e128c13
74b016b
 
e128c13
 
f71ca7d
74b016b
e128c13
74b016b
 
e128c13
 
 
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
import gradio as gr

# Load the model
model = gr.load(
    "models/dphn/Dolphin-Mistral-24B-Venice-Edition",
    provider="featherless-ai",
)

def chat_with_model(prompt):
    try:
        # Call the model with a single string, NOT wrapped in a list
        # This avoids the list-of-list issue
        response = model(prompt)
        return response  # Usually a string already
    except Exception as e:
        return f"⚠️ Error: {str(e)}"

# Gradio interface
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()