Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,11 +5,14 @@ from transformers import AutoModel, AutoConfig
|
|
5 |
|
6 |
hf_token = os.environ.get("HF_TOKEN")
|
7 |
|
8 |
-
|
|
|
9 |
|
10 |
try:
|
11 |
-
|
12 |
-
|
|
|
|
|
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 |
|