NagarajanB1990 commited on
Commit
b05862c
·
verified ·
1 Parent(s): 4fb0dcc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -1,12 +1,12 @@
1
  import gradio as gr
2
  from smolagents.agents import CodeAgent
3
- from smolagents.tools import CalculatorTool
4
  from smolagents.models import HfApiModel
5
 
6
  # Build agent
7
  agent = CodeAgent(
8
- tools=[CalculatorTool()],
9
- model=HfApiModel(model="HuggingFaceH4/zephyr-7b-alpha") # Small model
10
  )
11
 
12
  # Function
@@ -17,10 +17,10 @@ def ask_bot(question):
17
  # Gradio UI
18
  iface = gr.Interface(
19
  fn=ask_bot,
20
- inputs=gr.Textbox(label="Ask a math question"),
21
  outputs=gr.Textbox(label="Bot Answer"),
22
- title="Simple Math Helper Bot",
23
- description="Ask math or unit conversion questions — runs offline on CPU Space."
24
  )
25
 
26
  if __name__ == "__main__":
 
1
  import gradio as gr
2
  from smolagents.agents import CodeAgent
3
+ from smolagents.tools import PythonTool
4
  from smolagents.models import HfApiModel
5
 
6
  # Build agent
7
  agent = CodeAgent(
8
+ tools=[PythonTool()],
9
+ model=HfApiModel(model="HuggingFaceH4/zephyr-7b-alpha") # Small model for free CPU Space
10
  )
11
 
12
  # Function
 
17
  # Gradio UI
18
  iface = gr.Interface(
19
  fn=ask_bot,
20
+ inputs=gr.Textbox(label="Ask a math or coding question"),
21
  outputs=gr.Textbox(label="Bot Answer"),
22
+ title="Python Helper Bot",
23
+ description="Ask math or coding questions — runs offline on CPU Space."
24
  )
25
 
26
  if __name__ == "__main__":