Update app.py
Browse files
app.py
CHANGED
|
@@ -146,7 +146,8 @@ def gen_math_sol_together(api_key, prob_text, img_path=None, history=None):
|
|
| 146 |
|
| 147 |
if history is None:
|
| 148 |
history=[]
|
| 149 |
-
history.append(prob_text if prob_text.strip() else "Image problem ..", solution)
|
|
|
|
| 150 |
|
| 151 |
return solution, history
|
| 152 |
|
|
@@ -227,7 +228,7 @@ def create_demo():
|
|
| 227 |
)
|
| 228 |
with gr.Row():
|
| 229 |
together_submit_btn= gr.Button("Solve Problem", variant="primary")
|
| 230 |
-
together_clear_btn = gr.Button("
|
| 231 |
|
| 232 |
with gr.Column(scale=2):
|
| 233 |
together_solution_output= gr.Markdown(label="Solution")
|
|
@@ -236,7 +237,7 @@ def create_demo():
|
|
| 236 |
# Button actions
|
| 237 |
together_submit_btn.click(
|
| 238 |
fn=gen_math_sol_together,
|
| 239 |
-
inputs=[together_api_key,
|
| 240 |
outputs=[together_solution_output, together_conversation_history]
|
| 241 |
)
|
| 242 |
together_clear_btn.click(
|
|
|
|
| 146 |
|
| 147 |
if history is None:
|
| 148 |
history=[]
|
| 149 |
+
history.append((prob_text if prob_text.strip() else "Image problem ..", solution))
|
| 150 |
+
|
| 151 |
|
| 152 |
return solution, history
|
| 153 |
|
|
|
|
| 228 |
)
|
| 229 |
with gr.Row():
|
| 230 |
together_submit_btn= gr.Button("Solve Problem", variant="primary")
|
| 231 |
+
together_clear_btn = gr.Button("Clear")
|
| 232 |
|
| 233 |
with gr.Column(scale=2):
|
| 234 |
together_solution_output= gr.Markdown(label="Solution")
|
|
|
|
| 237 |
# Button actions
|
| 238 |
together_submit_btn.click(
|
| 239 |
fn=gen_math_sol_together,
|
| 240 |
+
inputs=[together_api_key, together_prob_input, together_image_input, together_conversation_history],
|
| 241 |
outputs=[together_solution_output, together_conversation_history]
|
| 242 |
)
|
| 243 |
together_clear_btn.click(
|