Mauricio-100 commited on
Commit
8775924
·
verified ·
1 Parent(s): 39f5261

Create core/model_loader.py

Browse files
Files changed (1) hide show
  1. core/model_loader.py +10 -0
core/model_loader.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import AutoModelForCausalLM
2
+ import torch
3
+
4
+ def load_model(model_name: str):
5
+ print(f"🧠 Chargement du modèle {model_name}...")
6
+ model = AutoModelForCausalLM.from_pretrained(
7
+ model_name,
8
+ torch_dtype=torch.bfloat16
9
+ )
10
+ return model