Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,13 +8,10 @@ hf_token = os.environ.get("HF_TOKEN")
|
|
8 |
model_repo = "HusseinEid/lora_model"
|
9 |
config_file = "adapter_config.json"
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
model = AutoModel.from_pretrained(model_repo, config=config, token=hf_token)
|
16 |
-
except OSError as e:
|
17 |
-
print(f"Error: {e}")
|
18 |
|
19 |
client = Groq(api_key = os.environ.get("GROQ_API_KEY"), )
|
20 |
|
|
|
8 |
model_repo = "HusseinEid/lora_model"
|
9 |
config_file = "adapter_config.json"
|
10 |
|
11 |
+
# Load the configuration directly from the repository
|
12 |
+
config = AutoConfig.from_pretrained(model_repo, config_file_name=config_file, token=hf_token)
|
13 |
+
# Load the model from Hugging Face using the config
|
14 |
+
model = AutoModel.from_pretrained(model_repo, config=config, token=hf_token)
|
|
|
|
|
|
|
15 |
|
16 |
client = Groq(api_key = os.environ.get("GROQ_API_KEY"), )
|
17 |
|