Update app.py
Browse files
app.py
CHANGED
|
@@ -11,11 +11,11 @@ from llama_cpp import Llama
|
|
| 11 |
from typing import Iterator
|
| 12 |
|
| 13 |
# Intentar importar spaces solo si estamos en un espacio de Hugging Face
|
| 14 |
-
try:
|
| 15 |
import spaces
|
| 16 |
-
SPACES_AVAILABLE = True
|
| 17 |
-
except ImportError:
|
| 18 |
-
SPACES_AVAILABLE = False
|
| 19 |
|
| 20 |
# Desactivar TorchDynamo para evitar errores de compilaci贸n
|
| 21 |
torch._dynamo.config.suppress_errors = True
|
|
@@ -395,8 +395,8 @@ def crear_prompt_desde_personaje(evt: gr.SelectData):
|
|
| 395 |
return "Crea una historia sobre un personaje m铆tico"
|
| 396 |
|
| 397 |
# Aplicar decorador @spaces.GPU si es necesario
|
| 398 |
-
if IS_HF_SPACE and SPACES_AVAILABLE and torch.cuda.is_available():
|
| 399 |
-
stream_iberotales_response = spaces.GPU(stream_iberotales_response)
|
| 400 |
|
| 401 |
# CSS personalizado para mejorar la apariencia
|
| 402 |
custom_css = """
|
|
|
|
| 11 |
from typing import Iterator
|
| 12 |
|
| 13 |
# Intentar importar spaces solo si estamos en un espacio de Hugging Face
|
| 14 |
+
#try:
|
| 15 |
import spaces
|
| 16 |
+
# SPACES_AVAILABLE = True
|
| 17 |
+
#except ImportError:
|
| 18 |
+
# SPACES_AVAILABLE = False
|
| 19 |
|
| 20 |
# Desactivar TorchDynamo para evitar errores de compilaci贸n
|
| 21 |
torch._dynamo.config.suppress_errors = True
|
|
|
|
| 395 |
return "Crea una historia sobre un personaje m铆tico"
|
| 396 |
|
| 397 |
# Aplicar decorador @spaces.GPU si es necesario
|
| 398 |
+
# if IS_HF_SPACE and SPACES_AVAILABLE and torch.cuda.is_available():
|
| 399 |
+
# stream_iberotales_response = spaces.GPU(stream_iberotales_response)
|
| 400 |
|
| 401 |
# CSS personalizado para mejorar la apariencia
|
| 402 |
custom_css = """
|