Spaces:
Running
Running
SkyNetWalker
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -78,25 +78,33 @@ models = [
|
|
78 |
#"meta-llama/Llama-3.3-70B-Instruct", #fail, need HF Pro subscription
|
79 |
]
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
label="
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
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__":
|