SkyNetWalker commited on
Commit
40b508f
·
verified ·
1 Parent(s): dcc0728

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -19
app.py CHANGED
@@ -78,25 +78,33 @@ models = [
78
  #"meta-llama/Llama-3.3-70B-Instruct", #fail, need HF Pro subscription
79
  ]
80
 
81
- demo = gr.ChatInterface(
82
- respond,
83
- additional_inputs=[
84
- gr.Textbox(value="", label="System message"),
85
- gr.Slider(minimum=1, maximum=4096, value=1024, step=1, label="Max new tokens"),
86
- gr.Slider(minimum=0.1, maximum=1.0, value=0.3, step=0.1, label="Temperature"),
87
- gr.Slider(
88
- minimum=0.1,
89
- maximum=1.0,
90
- value=0.95,
91
- step=0.05,
92
- label="Top-P",
93
- ),
94
- gr.Dropdown(choices=models, value=models[0], label="Model"), # Dropdown for model selection
95
- ],
96
- fill_height=True,
97
- chatbot=chatbot,
98
- #theme="Nymbo/Nymbo_Theme",
99
- )
 
 
 
 
 
 
 
 
100
  print("Gradio interface initialized.")
101
 
102
  if __name__ == "__main__":
 
78
  #"meta-llama/Llama-3.3-70B-Instruct", #fail, need HF Pro subscription
79
  ]
80
 
81
+ # Add a title and move the model dropdown to the top
82
+ with gr.Blocks() as demo:
83
+ gr.Markdown("# LLM Test (HF API)") # Add a title to the top of the UI
84
+
85
+ # Add the model dropdown above the chatbot
86
+ model_dropdown = gr.Dropdown(choices=models, value=models[0], label="Select Model")
87
+
88
+ # Use the existing ChatInterface
89
+ gr.ChatInterface(
90
+ respond,
91
+ additional_inputs=[
92
+ gr.Textbox(value="", label="System message"),
93
+ gr.Slider(minimum=1, maximum=4096, value=1024, step=1, label="Max new tokens"),
94
+ gr.Slider(minimum=0.1, maximum=1.0, value=0.3, step=0.1, label="Temperature"),
95
+ gr.Slider(
96
+ minimum=0.1,
97
+ maximum=1.0,
98
+ value=0.95,
99
+ step=0.05,
100
+ label="Top-P",
101
+ ),
102
+ model_dropdown, # Pass the dropdown as an additional input
103
+ ],
104
+ fill_height=True,
105
+ chatbot=chatbot,
106
+ )
107
+
108
  print("Gradio interface initialized.")
109
 
110
  if __name__ == "__main__":