Spaces:
Sleeping
Sleeping
Update model.py
Browse files
model.py
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
import torch
|
2 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
3 |
|
4 |
# Define model id
|
5 |
model_id = "meta-llama/Llama-3.2-1B"
|
@@ -9,7 +13,8 @@ pipe = pipeline(
|
|
9 |
"text-generation",
|
10 |
model=model_id,
|
11 |
torch_dtype=torch.bfloat16,
|
12 |
-
device_map="auto"
|
|
|
13 |
)
|
14 |
|
15 |
def modelFeedback(ats_score, resume_data, job_description):
|
|
|
1 |
import torch
|
2 |
from transformers import pipeline
|
3 |
+
import os
|
4 |
+
|
5 |
+
# Retrieve the token stored as a secret in the environment
|
6 |
+
hf_token = os.getenv('KEY2')
|
7 |
|
8 |
# Define model id
|
9 |
model_id = "meta-llama/Llama-3.2-1B"
|
|
|
13 |
"text-generation",
|
14 |
model=model_id,
|
15 |
torch_dtype=torch.bfloat16,
|
16 |
+
device_map="auto",
|
17 |
+
use_auth_token=hf_token
|
18 |
)
|
19 |
|
20 |
def modelFeedback(ats_score, resume_data, job_description):
|