Spaces:
Build error
Build error
add a calculator
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
# Super minimal app.py for troubleshooting
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import sys
|
| 4 |
|
|
@@ -12,11 +13,18 @@ for name, module in sys.modules.items():
|
|
| 12 |
# Simple function that doesn't require any ML models
|
| 13 |
def echo(text):
|
| 14 |
return f"You said: {text}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# Create a simple Gradio interface
|
| 17 |
demo = gr.Interface(
|
| 18 |
-
fn=
|
| 19 |
-
inputs=gr.Textbox(placeholder="
|
| 20 |
outputs=gr.Textbox(),
|
| 21 |
title="Micro Learning Platform - Debug Version",
|
| 22 |
description="This is a minimal version for troubleshooting"
|
|
|
|
| 1 |
# Super minimal app.py for troubleshooting
|
| 2 |
+
from json import tool
|
| 3 |
import gradio as gr
|
| 4 |
import sys
|
| 5 |
|
|
|
|
| 13 |
# Simple function that doesn't require any ML models
|
| 14 |
def echo(text):
|
| 15 |
return f"You said: {text}"
|
| 16 |
+
|
| 17 |
+
@tool
|
| 18 |
+
def calculator(a: int, b: int) -> int:
|
| 19 |
+
"""Multiply two integers."""
|
| 20 |
+
return a * b
|
| 21 |
+
|
| 22 |
+
print(calculator.to_string())
|
| 23 |
|
| 24 |
# Create a simple Gradio interface
|
| 25 |
demo = gr.Interface(
|
| 26 |
+
fn=calculator,
|
| 27 |
+
inputs=gr.Textbox(placeholder="Enter two numbers you want to multiply..."),
|
| 28 |
outputs=gr.Textbox(),
|
| 29 |
title="Micro Learning Platform - Debug Version",
|
| 30 |
description="This is a minimal version for troubleshooting"
|