VincentGOURBIN commited on
Commit
2aef8f1
·
verified ·
1 Parent(s): 2ac6735

Upload step03_chatbot.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. step03_chatbot.py +2 -1
step03_chatbot.py CHANGED
@@ -338,6 +338,7 @@ class Qwen3Reranker:
338
  if torch.cuda.is_available() and not next(self.model.parameters()).is_cuda:
339
  print(" - Déplacement du reranker vers GPU...")
340
  self.model = self.model.cuda()
 
341
 
342
  if instruction is None:
343
  instruction = self._get_default_instruction()
@@ -358,7 +359,7 @@ class Qwen3Reranker:
358
  self._cleanup_memory()
359
 
360
  except Exception as doc_error:
361
- print(f" ⚠️ Erreur document {i+1}: {doc_error}")
362
  scores.append(0.5) # Score neutre en cas d'erreur
363
 
364
  self._cleanup_memory()
 
338
  if torch.cuda.is_available() and not next(self.model.parameters()).is_cuda:
339
  print(" - Déplacement du reranker vers GPU...")
340
  self.model = self.model.cuda()
341
+ self.device = torch.device("cuda")
342
 
343
  if instruction is None:
344
  instruction = self._get_default_instruction()
 
359
  self._cleanup_memory()
360
 
361
  except Exception as doc_error:
362
+ print(f" ⚠️ Erreur document {i+1}: {type(doc_error).__name__}: {doc_error}")
363
  scores.append(0.5) # Score neutre en cas d'erreur
364
 
365
  self._cleanup_memory()