Dhahlan2000 commited on
Commit
d8aeb3b
·
1 Parent(s): 7c0b46d

Update app.py to replace 'use_auth_token' with 'token' in model and tokenizer initialization for compatibility with Hugging Face's latest API changes. This adjustment ensures proper authentication handling when loading the model and tokenizer.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -34,11 +34,11 @@ def extract_cv_text(file):
34
  access_token = os.getenv('token')
35
 
36
  # Initialize the tokenizer and model with the Hugging Face access token
37
- tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it", use_auth_token=access_token)
38
  model = AutoModelForCausalLM.from_pretrained(
39
  "google/gemma-2b-it",
40
  torch_dtype=torch.bfloat16,
41
- use_auth_token=access_token
42
  )
43
  model.eval() # Set the model to evaluation mode
44
 
 
34
  access_token = os.getenv('token')
35
 
36
  # Initialize the tokenizer and model with the Hugging Face access token
37
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it", token=access_token)
38
  model = AutoModelForCausalLM.from_pretrained(
39
  "google/gemma-2b-it",
40
  torch_dtype=torch.bfloat16,
41
+ token=access_token
42
  )
43
  model.eval() # Set the model to evaluation mode
44