baconnier commited on
Commit
8358568
·
verified ·
1 Parent(s): 225d015

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -55,7 +55,7 @@ model_id = "baconnier/Napoleon_4B_V0.0"
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
 
@@ -65,7 +65,6 @@ if not hasattr(config, "hidden_size"):
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
 
@@ -75,6 +74,9 @@ if not hasattr(config, "num_attention_heads"):
75
  if not hasattr(config, "sliding_window"):
76
  config.sliding_window = 1024 # Valeur correcte pour Gemma 3
77
 
 
 
 
78
  if not hasattr(config, "rope_scaling"):
79
  config.rope_scaling = {"factor": 8.0, "rope_type": "linear"} # Valeur correcte pour Gemma 3
80
 
 
55
  # Charger la configuration
56
  config = AutoConfig.from_pretrained(model_id)
57
 
58
+ # Ajouter tous les attributs manquants
59
  if not hasattr(config, "vocab_size"):
60
  config.vocab_size = 262208 # Valeur correcte pour Gemma 3
61
 
 
65
  if not hasattr(config, "num_hidden_layers"):
66
  config.num_hidden_layers = 34 # Valeur correcte pour Gemma 3 4B
67
 
 
68
  if not hasattr(config, "intermediate_size"):
69
  config.intermediate_size = 10240 # Valeur correcte pour Gemma 3 4B
70
 
 
74
  if not hasattr(config, "sliding_window"):
75
  config.sliding_window = 1024 # Valeur correcte pour Gemma 3
76
 
77
+ if not hasattr(config, "sliding_window_pattern"):
78
+ config.sliding_window_pattern = 6 # Valeur basée sur votre config Napoleon
79
+
80
  if not hasattr(config, "rope_scaling"):
81
  config.rope_scaling = {"factor": 8.0, "rope_type": "linear"} # Valeur correcte pour Gemma 3
82