Update app.py
Browse files
app.py
CHANGED
|
@@ -9,13 +9,8 @@ from huggingface_hub import hf_hub_download
|
|
| 9 |
import re
|
| 10 |
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 |
-
|
| 17 |
-
#except ImportError:
|
| 18 |
-
# SPACES_AVAILABLE = False
|
| 19 |
|
| 20 |
# Desactivar TorchDynamo para evitar errores de compilaci贸n
|
| 21 |
torch._dynamo.config.suppress_errors = True
|
|
@@ -29,13 +24,6 @@ GGUF_REVISION = "main"
|
|
| 29 |
MAX_MAX_NEW_TOKENS = 2048
|
| 30 |
DEFAULT_MAX_NEW_TOKENS = 2048
|
| 31 |
|
| 32 |
-
# Verificar si estamos en un espacio de Hugging Face
|
| 33 |
-
IS_HF_SPACE = any([
|
| 34 |
-
os.getenv("SPACE_ID") is not None,
|
| 35 |
-
os.getenv("SPACE_AUTHOR_NAME") is not None,
|
| 36 |
-
os.getenv("SPACE_REPO_NAME") is not None,
|
| 37 |
-
os.getenv("SPACE_HOST") is not None,
|
| 38 |
-
])
|
| 39 |
|
| 40 |
# System prompt personalizado
|
| 41 |
DEFAULT_SYSTEM_MESSAGE = """Resuelve el siguiente problema.
|
|
|
|
| 9 |
import re
|
| 10 |
from llama_cpp import Llama
|
| 11 |
from typing import Iterator
|
|
|
|
|
|
|
|
|
|
| 12 |
import spaces
|
| 13 |
+
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Desactivar TorchDynamo para evitar errores de compilaci贸n
|
| 16 |
torch._dynamo.config.suppress_errors = True
|
|
|
|
| 24 |
MAX_MAX_NEW_TOKENS = 2048
|
| 25 |
DEFAULT_MAX_NEW_TOKENS = 2048
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
# System prompt personalizado
|
| 29 |
DEFAULT_SYSTEM_MESSAGE = """Resuelve el siguiente problema.
|