giustinod commited on
Commit
60fd417
1 Parent(s): 28a1185

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- 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(
32
- model_path,
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