johnometalman commited on
Commit
4d9ef05
·
1 Parent(s): fefdd6e

prueba con otro loader del modelo

Browse files
Files changed (1) hide show
  1. utils.py +5 -3
utils.py CHANGED
@@ -1,12 +1,14 @@
1
- from transformers import AutoModel
2
 
3
  def carga_modelo(repo_id, token):
4
  try:
5
- # Attempt to load the model from Hugging Face with authentication token
6
- return AutoModel.from_pretrained(repo_id, use_auth_token=token)
 
7
  except Exception as e:
8
  raise ValueError(f"Error loading model: {str(e)}")
9
 
 
10
  def genera(modelo_gan, n_mariposas):
11
  # Your generation logic here (for example, generating images)
12
  # This is just a placeholder
 
1
+ from transformers import AutoFeatureExtractor
2
 
3
  def carga_modelo(repo_id, token):
4
  try:
5
+ # Try loading the model as a feature extractor
6
+ model = AutoFeatureExtractor.from_pretrained(repo_id, use_auth_token=token)
7
+ return model
8
  except Exception as e:
9
  raise ValueError(f"Error loading model: {str(e)}")
10
 
11
+
12
  def genera(modelo_gan, n_mariposas):
13
  # Your generation logic here (for example, generating images)
14
  # This is just a placeholder