Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,8 +53,8 @@ def load_model(model_name):
|
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
-
def model_launch(input,
|
| 57 |
-
return f"Model: {
|
| 58 |
# geomodel_llm=load_model(selected_model)
|
| 59 |
# template = "Instruction:\n{instruction}\n\nResponse:\n{response}"
|
| 60 |
# prompt = template.format(
|
|
@@ -159,6 +159,10 @@ def submit_question(question_content):
|
|
| 159 |
#return out[ind:]
|
| 160 |
return model_output [ind:] #model_output
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
def clear_output():
|
| 163 |
return "", ""
|
| 164 |
|
|
@@ -201,7 +205,10 @@ with gr.Blocks() as iface:
|
|
| 201 |
value=None
|
| 202 |
# visible=False # Initially hidden
|
| 203 |
)
|
| 204 |
-
#
|
|
|
|
|
|
|
|
|
|
| 205 |
# Editable question text box
|
| 206 |
with gr.Row():
|
| 207 |
question_edit = gr.Textbox(
|
|
@@ -231,7 +238,7 @@ with gr.Blocks() as iface:
|
|
| 231 |
|
| 232 |
submit_button.click(
|
| 233 |
fn=model_launch,#submit_question, ## model_launch
|
| 234 |
-
inputs=[question_edit,
|
| 235 |
outputs=[model_response]
|
| 236 |
)
|
| 237 |
|
|
|
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
+
def model_launch(input,selected_output):
|
| 57 |
+
return f"Model: {selected_output}\nResponse to: {input}"
|
| 58 |
# geomodel_llm=load_model(selected_model)
|
| 59 |
# template = "Instruction:\n{instruction}\n\nResponse:\n{response}"
|
| 60 |
# prompt = template.format(
|
|
|
|
| 159 |
#return out[ind:]
|
| 160 |
return model_output [ind:] #model_output
|
| 161 |
|
| 162 |
+
# Define a function to display the selected model
|
| 163 |
+
def display_selected_model(selected_model):
|
| 164 |
+
return f"Selected Model: {selected_model}"
|
| 165 |
+
|
| 166 |
def clear_output():
|
| 167 |
return "", ""
|
| 168 |
|
|
|
|
| 205 |
value=None
|
| 206 |
# visible=False # Initially hidden
|
| 207 |
)
|
| 208 |
+
# Create a Textbox to display the selected model
|
| 209 |
+
selected_output = gr.Textbox(label="Selected Model", interactive=False)
|
| 210 |
+
#select_button = gr.Button("Select Model", variant="primary")
|
| 211 |
+
|
| 212 |
# Editable question text box
|
| 213 |
with gr.Row():
|
| 214 |
question_edit = gr.Textbox(
|
|
|
|
| 238 |
|
| 239 |
submit_button.click(
|
| 240 |
fn=model_launch,#submit_question, ## model_launch
|
| 241 |
+
inputs=[question_edit, selected_output], # Include the dropdown in inputs
|
| 242 |
outputs=[model_response]
|
| 243 |
)
|
| 244 |
|