AItool commited on
Commit
a28ffcf
·
verified ·
1 Parent(s): 018b8a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -5
app.py CHANGED
@@ -63,19 +63,30 @@ def chat_with_model(user_input, model_choice):
63
  # Gradio UI
64
  with gr.Blocks(title="Phi-3 Instruct Explorer") as demo:
65
  gr.Markdown("## 🧠 Phi-3 Instruct Explorer\nSwitch between Phi-3 instruct models and test responses on CPU.")
 
66
  with gr.Row():
67
- gr.Markdown("### 🧪 Try an example prompt:")
68
- with gr.Row():
69
- examples = gr.Dataset(components=[user_input], samples=[[e] for e in EXAMPLES])
70
- with gr.Row():
71
- model_choice = gr.Dropdown(label="Choose a model", choices=list(MODEL_OPTIONS.keys()), value="Phi-3.5 Mini Instruct")
 
72
  with gr.Row():
73
  user_input = gr.Textbox(label="Your message", placeholder="Ask me anything...")
 
74
  with gr.Row():
75
  output = gr.Textbox(label="Model response")
 
76
  with gr.Row():
77
  submit = gr.Button("Generate")
78
 
 
 
 
 
 
 
 
79
  submit.click(fn=chat_with_model, inputs=[user_input, model_choice], outputs=output)
80
 
81
  demo.launch()
 
63
  # Gradio UI
64
  with gr.Blocks(title="Phi-3 Instruct Explorer") as demo:
65
  gr.Markdown("## 🧠 Phi-3 Instruct Explorer\nSwitch between Phi-3 instruct models and test responses on CPU.")
66
+
67
  with gr.Row():
68
+ model_choice = gr.Dropdown(
69
+ label="Choose a model",
70
+ choices=list(MODEL_OPTIONS.keys()),
71
+ value="Phi-3.5 Mini Instruct"
72
+ )
73
+
74
  with gr.Row():
75
  user_input = gr.Textbox(label="Your message", placeholder="Ask me anything...")
76
+
77
  with gr.Row():
78
  output = gr.Textbox(label="Model response")
79
+
80
  with gr.Row():
81
  submit = gr.Button("Generate")
82
 
83
+ # Example prompts
84
+ gr.Markdown("### 🧪 Try an example prompt:")
85
+ gr.Examples(
86
+ examples=EXAMPLES,
87
+ inputs=user_input
88
+ )
89
+
90
  submit.click(fn=chat_with_model, inputs=[user_input, model_choice], outputs=output)
91
 
92
  demo.launch()