ldrissi commited on
Commit
ce96a72
·
1 Parent(s): 33c2628

add a calculator

Browse files
Files changed (1) hide show
  1. app.py +10 -2
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=echo,
19
- inputs=gr.Textbox(placeholder="Type something here..."),
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"