giustinod commited on
Commit
28a1185
1 Parent(s): 28952b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- import streamlit as st
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=st.secrets["HF_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(