Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -55,11 +55,23 @@ model_id = "baconnier/Napoleon_4B_V0.0"
|
|
55 |
# Charger la configuration
|
56 |
config = AutoConfig.from_pretrained(model_id)
|
57 |
|
58 |
-
# Ajouter
|
59 |
if not hasattr(config, "vocab_size"):
|
60 |
-
config.vocab_size =
|
|
|
61 |
if not hasattr(config, "hidden_size"):
|
62 |
-
config.hidden_size = 2560 # Valeur
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
65 |
model = AutoModelForCausalLM.from_pretrained(
|
|
|
55 |
# Charger la configuration
|
56 |
config = AutoConfig.from_pretrained(model_id)
|
57 |
|
58 |
+
# Ajouter les attributs manquants
|
59 |
if not hasattr(config, "vocab_size"):
|
60 |
+
config.vocab_size = 262208 # Valeur correcte pour Gemma 3
|
61 |
+
|
62 |
if not hasattr(config, "hidden_size"):
|
63 |
+
config.hidden_size = 2560 # Valeur correcte pour Gemma 3 4B
|
64 |
+
|
65 |
+
if not hasattr(config, "num_hidden_layers"):
|
66 |
+
config.num_hidden_layers = 34 # Valeur correcte pour Gemma 3 4B
|
67 |
+
|
68 |
+
# Autres attributs potentiellement nécessaires
|
69 |
+
if not hasattr(config, "intermediate_size"):
|
70 |
+
config.intermediate_size = 10240 # Valeur correcte pour Gemma 3 4B
|
71 |
+
|
72 |
+
if not hasattr(config, "num_attention_heads"):
|
73 |
+
config.num_attention_heads = 10 # Valeur correcte pour Gemma 3 4B
|
74 |
+
|
75 |
|
76 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
77 |
model = AutoModelForCausalLM.from_pretrained(
|