Spaces:
Running
Running
Force TinyLlama for CPU deployment
Browse files
app.py
CHANGED
|
@@ -71,7 +71,7 @@ def generate_text(model, tokenizer, prompt, max_new_tokens=150, temperature=0.1)
|
|
| 71 |
# Chargement au démarrage (utilise TinyLlama si pas de GPU pour éviter OOM)
|
| 72 |
print("Chargement du modèle...")
|
| 73 |
try:
|
| 74 |
-
if
|
| 75 |
model, tokenizer = load_model("biomistral", quantize=True)
|
| 76 |
print(f"✅ BioMistral-7B chargé — GPU: {torch.cuda.get_device_name(0)}")
|
| 77 |
else:
|
|
@@ -376,7 +376,7 @@ def run_pipeline(text, synth_lang="fr", agents_enabled=None):
|
|
| 376 |
}
|
| 377 |
|
| 378 |
gc.collect()
|
| 379 |
-
if
|
| 380 |
torch.cuda.empty_cache()
|
| 381 |
return R
|
| 382 |
|
|
|
|
| 71 |
# Chargement au démarrage (utilise TinyLlama si pas de GPU pour éviter OOM)
|
| 72 |
print("Chargement du modèle...")
|
| 73 |
try:
|
| 74 |
+
if False: # Force TinyLlama on CPU
|
| 75 |
model, tokenizer = load_model("biomistral", quantize=True)
|
| 76 |
print(f"✅ BioMistral-7B chargé — GPU: {torch.cuda.get_device_name(0)}")
|
| 77 |
else:
|
|
|
|
| 376 |
}
|
| 377 |
|
| 378 |
gc.collect()
|
| 379 |
+
if False: # Force TinyLlama on CPU
|
| 380 |
torch.cuda.empty_cache()
|
| 381 |
return R
|
| 382 |
|