Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
from smolagents.agents import CodeAgent
|
3 |
-
from smolagents.tools import
|
4 |
from smolagents.models import HfApiModel
|
5 |
|
6 |
# Build agent
|
7 |
agent = CodeAgent(
|
8 |
-
tools=[
|
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="
|
23 |
-
description="Ask math or
|
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__":
|