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

refactor: remove unused imports and clarify decorator usage in calculator function

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -1,5 +1,4 @@
1
  # Super minimal app.py for troubleshooting
2
- from json import tool
3
  import gradio as gr
4
  import sys
5
 
@@ -14,18 +13,18 @@ for name, module in sys.modules.items():
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"
31
  )
 
1
  # Super minimal app.py for troubleshooting
 
2
  import gradio as gr
3
  import sys
4
 
 
13
  def echo(text):
14
  return f"You said: {text}"
15
 
16
+ # @tool # This decorator's origin is unclear or its library is not imported.
17
+ # If it's from a library like langchain, ensure it's installed and imported.
18
+ # For a minimal example, it's safer to remove it if its definition isn't present.
19
  def calculator(a: int, b: int) -> int:
20
  """Multiply two integers."""
21
  return a * b
22
 
 
 
23
  # Create a simple Gradio interface
24
  demo = gr.Interface(
25
  fn=calculator,
26
+ inputs=[gr.Number(label="First Number (a)"), gr.Number(label="Second Number (b)")],
27
+ outputs=gr.Number(label="Result (a * b)"),
28
  title="Micro Learning Platform - Debug Version",
29
  description="This is a minimal version for troubleshooting"
30
  )