Update app.py
Browse files
app.py
CHANGED
|
@@ -169,7 +169,10 @@ def solve_polynomial(image, llm_url):
|
|
| 169 |
except Exception as e:
|
| 170 |
return f"β **Error**: {str(e)}", "", ""
|
| 171 |
|
| 172 |
-
|
|
|
|
|
|
|
|
|
|
| 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")
|
|
@@ -186,6 +189,6 @@ with gr.Blocks() as demo:
|
|
| 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()
|
|
|
|
|
|
| 169 |
except Exception as e:
|
| 170 |
return f"β **Error**: {str(e)}", "", ""
|
| 171 |
|
| 172 |
+
def wrapped_solver(img, url):
|
| 173 |
+
result, cleaned, _ = solve_polynomial(img, url)
|
| 174 |
+
return result, cleaned
|
| 175 |
+
|
| 176 |
with gr.Blocks() as demo:
|
| 177 |
llm_url = gr.Textbox(label="π Enter LLM Microservice URL (from Colab)", placeholder="https://xxxx.ngrok-free.app")
|
| 178 |
image_input = gr.Image(type="pil", label="π· Upload Image of Polynomial")
|
|
|
|
| 189 |
demo.title = "π§ Polynomial Solver from Image"
|
| 190 |
demo.description = "Upload a polynomial image (typed or handwritten). View symbolic steps and human-style explanation."
|
| 191 |
|
|
|
|
| 192 |
if __name__ == "__main__":
|
| 193 |
demo.launch()
|
| 194 |
+
|