Ibou17 commited on
Commit
fed2739
·
1 Parent(s): e4d7f15

Force TinyLlama for CPU deployment

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 torch.cuda.is_available():
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 torch.cuda.is_available():
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