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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -1,12 +1,10 @@
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,10 +15,10 @@ def ask_bot(question):
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__":
 
1
  import gradio as gr
2
+ from smolagents import CodeAgent, PythonTool, HfApiModel
 
 
3
 
4
  # Build agent
5
  agent = CodeAgent(
6
  tools=[PythonTool()],
7
+ model=HfApiModel(model="HuggingFaceH4/zephyr-7b-alpha") # works on free CPU Space
8
  )
9
 
10
  # Function
 
15
  # Gradio UI
16
  iface = gr.Interface(
17
  fn=ask_bot,
18
+ inputs=gr.Textbox(label="Ask a math or code question"),
19
  outputs=gr.Textbox(label="Bot Answer"),
20
  title="Python Helper Bot",
21
+ description="Ask math or Python questions — runs offline on CPU Space."
22
  )
23
 
24
  if __name__ == "__main__":