Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,21 @@
|
|
| 1 |
# app.py
|
| 2 |
-
from smolagent import SmolAgent
|
| 3 |
import gradio as gr
|
|
|
|
| 4 |
|
| 5 |
-
agent =
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
| 8 |
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# import gradio as gr
|
| 11 |
# from huggingface_hub import InferenceClient
|
|
|
|
| 1 |
# app.py
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
+
from transformers import HfAgent
|
| 4 |
|
| 5 |
+
agent = HfAgent("https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta")
|
| 6 |
|
| 7 |
+
def chat_fn(input_text):
|
| 8 |
+
return agent.run(input_text)
|
| 9 |
+
|
| 10 |
+
iface = gr.Interface(fn=chat_fn, inputs="text", outputs="text")
|
| 11 |
iface.launch()
|
| 12 |
+
# from smolagent import SmolAgent
|
| 13 |
+
# import gradio as gr
|
| 14 |
+
|
| 15 |
+
# agent = SmolAgent(tools=["python", "terminal"])
|
| 16 |
+
|
| 17 |
+
# iface = gr.ChatInterface(agent.chat, title="SmolAgent Chat")
|
| 18 |
+
# iface.launch()
|
| 19 |
|
| 20 |
# import gradio as gr
|
| 21 |
# from huggingface_hub import InferenceClient
|