HusseinEid commited on
Commit
d7d5dcd
·
verified ·
1 Parent(s): e38f678

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -5,11 +5,14 @@ from transformers import AutoModel, AutoConfig
5
 
6
  hf_token = os.environ.get("HF_TOKEN")
7
 
8
- local_config_path = "HusseinEid/lora_model/tree/main/adapter_config.json"
 
9
 
10
  try:
11
- config = AutoConfig.from_pretrained(local_config_path)
12
- model = AutoModel.from_pretrained("HusseinEid/lora_model", config=config, token=hf_token)
 
 
13
  except OSError as e:
14
  print(f"Error: {e}")
15
 
 
5
 
6
  hf_token = os.environ.get("HF_TOKEN")
7
 
8
+ model_repo = "HusseinEid/lora_model"
9
+ config_file = "adapter_config.json"
10
 
11
  try:
12
+ # Load the configuration directly from the repository
13
+ config = AutoConfig.from_pretrained(model_repo, config=config_file, token=hf_token)
14
+ # Load the model from Hugging Face using the config
15
+ model = AutoModel.from_pretrained(model_repo, config=config, token=hf_token)
16
  except OSError as e:
17
  print(f"Error: {e}")
18