Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -22,16 +22,16 @@ MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "2048"))
|
|
22 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
23 |
|
24 |
# thanks to: https://medium.com/@ashkanpakzad/hugging-face-public-space-private-model-w-streamlit-app-0166b4f66869
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
model_path = hf_hub_download(repo_id=repo_id, filename="model.pkl", token=api_key)
|
29 |
|
30 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
31 |
model = AutoModelForCausalLM.from_pretrained(
|
32 |
-
|
33 |
device_map="auto",
|
34 |
torch_dtype=torch.bfloat16,
|
|
|
35 |
)
|
36 |
model.eval()
|
37 |
|
|
|
22 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
23 |
|
24 |
# thanks to: https://medium.com/@ashkanpakzad/hugging-face-public-space-private-model-w-streamlit-app-0166b4f66869
|
25 |
+
access_token = os.getenv("HF_TOKEN")
|
26 |
+
print('access_token: ' + access_token)
|
27 |
+
model_id = "giustinod/TestLogica-AZService"
|
|
|
28 |
|
29 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
30 |
model = AutoModelForCausalLM.from_pretrained(
|
31 |
+
model_id,
|
32 |
device_map="auto",
|
33 |
torch_dtype=torch.bfloat16,
|
34 |
+
token=access_token
|
35 |
)
|
36 |
model.eval()
|
37 |
|