FigmaPrompt commited on
Commit ·
1d05d78
1
Parent(s): 7562ef2
Add application file
Browse files
app.py
CHANGED
|
@@ -47,7 +47,7 @@ if tokenizer.pad_token is None:
|
|
| 47 |
|
| 48 |
model = None # ← se carga solo cuando hace falta
|
| 49 |
|
| 50 |
-
@
|
| 51 |
def load_model():
|
| 52 |
"""Carga el modelo SOLO cuando ZeroGPU lo activa."""
|
| 53 |
global model
|
|
@@ -73,7 +73,7 @@ def build_prompt(system_prompt: str, context: str, instruction: str) -> str:
|
|
| 73 |
)
|
| 74 |
|
| 75 |
|
| 76 |
-
@
|
| 77 |
def generar_formula(instruction: str, contexto_nombre: str, temperatura: float, max_tokens: int):
|
| 78 |
if not instruction.strip():
|
| 79 |
return "⚠️ Escribe una instrucción de negocio."
|
|
|
|
| 47 |
|
| 48 |
model = None # ← se carga solo cuando hace falta
|
| 49 |
|
| 50 |
+
@spaces.GPU
|
| 51 |
def load_model():
|
| 52 |
"""Carga el modelo SOLO cuando ZeroGPU lo activa."""
|
| 53 |
global model
|
|
|
|
| 73 |
)
|
| 74 |
|
| 75 |
|
| 76 |
+
@spaces.GPU
|
| 77 |
def generar_formula(instruction: str, contexto_nombre: str, temperatura: float, max_tokens: int):
|
| 78 |
if not instruction.strip():
|
| 79 |
return "⚠️ Escribe una instrucción de negocio."
|