Spaces:
Runtime error
Runtime error
Commit
·
8c9bea9
1
Parent(s):
309fec2
Add gpu
Browse files- app.py +2 -0
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -2,6 +2,7 @@ from typing import List
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
import PIL
|
|
|
|
| 5 |
from gradio import ChatMessage
|
| 6 |
from smolagents.gradio_ui import stream_to_gradio
|
| 7 |
|
|
@@ -20,6 +21,7 @@ def resize_image(image):
|
|
| 20 |
return image
|
| 21 |
|
| 22 |
|
|
|
|
| 23 |
def chat_interface_fn(input_request, history: List[ChatMessage], gallery, anthropic_api_key, anthropic_model_id):
|
| 24 |
model = get_anthropic_model(anthropic_model_id, anthropic_api_key)
|
| 25 |
agent = get_master_agent(model)
|
|
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
import PIL
|
| 5 |
+
import spaces
|
| 6 |
from gradio import ChatMessage
|
| 7 |
from smolagents.gradio_ui import stream_to_gradio
|
| 8 |
|
|
|
|
| 21 |
return image
|
| 22 |
|
| 23 |
|
| 24 |
+
@spaces.GPU
|
| 25 |
def chat_interface_fn(input_request, history: List[ChatMessage], gallery, anthropic_api_key, anthropic_model_id):
|
| 26 |
model = get_anthropic_model(anthropic_model_id, anthropic_api_key)
|
| 27 |
agent = get_master_agent(model)
|
requirements.txt
CHANGED
|
@@ -100,7 +100,7 @@ pillow==11.2.1
|
|
| 100 |
prompt-toolkit==3.0.51
|
| 101 |
propcache==0.3.1
|
| 102 |
protobuf==6.31.1
|
| 103 |
-
psutil==
|
| 104 |
pyarrow==20.0.0
|
| 105 |
pydantic==2.11.5
|
| 106 |
pydantic-core==2.33.2
|
|
@@ -132,6 +132,7 @@ sigtools==4.0.1
|
|
| 132 |
six==1.17.0
|
| 133 |
smolagents==1.17.0
|
| 134 |
sniffio==1.3.1
|
|
|
|
| 135 |
sqlalchemy==2.0.41
|
| 136 |
sse-starlette==2.3.6
|
| 137 |
starlette==0.46.2
|
|
|
|
| 100 |
prompt-toolkit==3.0.51
|
| 101 |
propcache==0.3.1
|
| 102 |
protobuf==6.31.1
|
| 103 |
+
psutil==5.9.8
|
| 104 |
pyarrow==20.0.0
|
| 105 |
pydantic==2.11.5
|
| 106 |
pydantic-core==2.33.2
|
|
|
|
| 132 |
six==1.17.0
|
| 133 |
smolagents==1.17.0
|
| 134 |
sniffio==1.3.1
|
| 135 |
+
spaces==0.37.0
|
| 136 |
sqlalchemy==2.0.41
|
| 137 |
sse-starlette==2.3.6
|
| 138 |
starlette==0.46.2
|