danielramos commited on
Commit ·
2769fa1
1
Parent(s): c5ebddd
fix: clean spaces import for local IDE and Hugging Face ZeroGPU
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from main import (
|
| 3 |
graph_app,
|
| 4 |
HumanMessage,
|
|
@@ -8,19 +9,6 @@ from main import (
|
|
| 8 |
app as fastapi_app
|
| 9 |
)
|
| 10 |
|
| 11 |
-
# Soporte para Hugging Face ZeroGPU
|
| 12 |
-
try:
|
| 13 |
-
import spaces
|
| 14 |
-
except ImportError:
|
| 15 |
-
class spaces:
|
| 16 |
-
@staticmethod
|
| 17 |
-
def GPU(func=None, duration=None):
|
| 18 |
-
if func is not None:
|
| 19 |
-
return func
|
| 20 |
-
def decorator(f):
|
| 21 |
-
return f
|
| 22 |
-
return decorator
|
| 23 |
-
|
| 24 |
@spaces.GPU
|
| 25 |
def chat_fn(message, history):
|
| 26 |
messages = [SystemMessage(content=DEFAULT_SYSTEM_PROMPT)]
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import spaces
|
| 3 |
from main import (
|
| 4 |
graph_app,
|
| 5 |
HumanMessage,
|
|
|
|
| 9 |
app as fastapi_app
|
| 10 |
)
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
@spaces.GPU
|
| 13 |
def chat_fn(message, history):
|
| 14 |
messages = [SystemMessage(content=DEFAULT_SYSTEM_PROMPT)]
|