yzhuang commited on
Commit
f31f69d
·
1 Parent(s): c1965a3
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -4,7 +4,7 @@ import requests
4
  import sseclient
5
  import gradio as gr
6
 
7
- API_URL = "http://localhost:8000/v1/chat/completions"
8
 
9
 
10
  def stream_completion(message, history, max_tokens, temperature, top_p, beta):
@@ -52,18 +52,19 @@ def stream_completion(message, history, max_tokens, temperature, top_p, beta):
52
 
53
 
54
  # ----------------------- UI ---------------------------------------------
55
- with gr.Blocks(title="🧪 Mixture of Inputs (MoI) Demo") as demo:
56
  gr.Markdown(
57
- "## 🧪 Mixture of Inputs (MoI) Demo \n"
58
- "Streaming local vLLM demo with dynamic **beta** adjustment."
59
  )
60
 
61
  # sliders first – all on one row
62
  with gr.Row():
63
- max_tokens = gr.Slider(1, 2048, value=512, step=1, label="Max new tokens")
64
  temperature = gr.Slider(0.1, 4.0, value=0.7, step=0.1, label="Temperature")
65
  top_p = gr.Slider(0.1, 1.0, value=0.95, step=0.05, label="Top-p")
66
- beta = gr.Slider(0.0, 10.0, value=1.0, step=0.1, label="MoI Beta")
 
67
 
68
  chatbot = gr.Chatbot(height=450)
69
  user_box = gr.Textbox(placeholder="Type a message and press Enter…", show_label=False)
 
4
  import sseclient
5
  import gradio as gr
6
 
7
+ API_URL = "http://localhost:8000/v1/completions"
8
 
9
 
10
  def stream_completion(message, history, max_tokens, temperature, top_p, beta):
 
52
 
53
 
54
  # ----------------------- UI ---------------------------------------------
55
+ with gr.Blocks(title="🎨 Mixture of Inputs (MoI) Demo") as demo:
56
  gr.Markdown(
57
+ "## 🎨 Mixture of Inputs (MoI) Demo \n"
58
+ "Streaming vLLM demo with dynamic **beta** adjustment in MoI, higher beta means less blending."
59
  )
60
 
61
  # sliders first – all on one row
62
  with gr.Row():
63
+ beta = gr.Slider(0.0, 10.0, value=1.0, step=0.1, label="MoI Beta")
64
  temperature = gr.Slider(0.1, 4.0, value=0.7, step=0.1, label="Temperature")
65
  top_p = gr.Slider(0.1, 1.0, value=0.95, step=0.05, label="Top-p")
66
+ max_tokens = gr.Slider(1, 2048, value=512, step=1, label="Max new tokens")
67
+
68
 
69
  chatbot = gr.Chatbot(height=450)
70
  user_box = gr.Textbox(placeholder="Type a message and press Enter…", show_label=False)