Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -22,10 +22,10 @@ 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 |
from huggingface_hub import hf_hub_download
|
27 |
repo_id = "giustinod/TestLogica-AZService"
|
28 |
-
model_path = hf_hub_download(repo_id=repo_id, filename="model.pkl", token=
|
29 |
|
30 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
31 |
model = AutoModelForCausalLM.from_pretrained(
|
|
|
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 |
+
api_key = os.getenv("HF_TOKEN")
|
26 |
from huggingface_hub import hf_hub_download
|
27 |
repo_id = "giustinod/TestLogica-AZService"
|
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(
|