MasteredUltraInstinct commited on
Commit
d8f8d73
Β·
verified Β·
1 Parent(s): f4ab496

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -173,22 +173,19 @@ def solve_polynomial(image, llm_url):
173
  with gr.Blocks() as demo:
174
  llm_url = gr.Textbox(label="πŸ”— Enter LLM Microservice URL (from Colab)", placeholder="https://xxxx.ngrok-free.app")
175
  image_input = gr.Image(type="pil", label="πŸ“· Upload Image of Polynomial")
176
- output_box = gr.Markdown(label="πŸ“‹ Step-by-step Solution")
177
- explain_box = gr.Markdown(label="πŸ—£οΈ Human-style Explanation")
178
  hidden_latex = gr.Textbox(visible=False)
179
 
180
- def wrapped_solver(img, url):
181
- result, cleaned, _ = solve_polynomial(img, url)
182
- return result, cleaned
183
-
184
  submit_btn = gr.Button("πŸ” Solve")
185
  submit_btn.click(fn=wrapped_solver, inputs=[image_input, llm_url], outputs=[output_box, hidden_latex])
186
 
 
187
  explain_btn = gr.Button("🧠 Explain Human-Solution")
188
  explain_btn.click(fn=request_llm_explanation, inputs=[hidden_latex, llm_url], outputs=explain_box)
189
 
190
  demo.title = "🧠 Polynomial Solver from Image"
191
  demo.description = "Upload a polynomial image (typed or handwritten). View symbolic steps and human-style explanation."
192
 
 
193
  if __name__ == "__main__":
194
  demo.launch()
 
173
  with gr.Blocks() as demo:
174
  llm_url = gr.Textbox(label="πŸ”— Enter LLM Microservice URL (from Colab)", placeholder="https://xxxx.ngrok-free.app")
175
  image_input = gr.Image(type="pil", label="πŸ“· Upload Image of Polynomial")
 
 
176
  hidden_latex = gr.Textbox(visible=False)
177
 
178
+ output_box = gr.Markdown(label="πŸ“‹ Step-by-step Solution")
 
 
 
179
  submit_btn = gr.Button("πŸ” Solve")
180
  submit_btn.click(fn=wrapped_solver, inputs=[image_input, llm_url], outputs=[output_box, hidden_latex])
181
 
182
+ explain_box = gr.Markdown(label="πŸ—£οΈ Human-style Explanation")
183
  explain_btn = gr.Button("🧠 Explain Human-Solution")
184
  explain_btn.click(fn=request_llm_explanation, inputs=[hidden_latex, llm_url], outputs=explain_box)
185
 
186
  demo.title = "🧠 Polynomial Solver from Image"
187
  demo.description = "Upload a polynomial image (typed or handwritten). View symbolic steps and human-style explanation."
188
 
189
+
190
  if __name__ == "__main__":
191
  demo.launch()