Paulhayes commited on
Commit
edca38c
·
verified ·
1 Parent(s): 5dc442f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1681,6 +1681,10 @@ class Hive:
1681
  self.pipe = _remote_pipe
1682
  # For remote inference, we still need a local tokenizer for prompt compilation
1683
  self.tok = AutoTokenizer.from_pretrained(self.model_id, trust_remote_code=trust, chat_template=None)
 
 
 
 
1684
  self.model = None # No local model needed
1685
  self.stopping_criteria = None # Not used with InferenceClient
1686
  else:
 
1681
  self.pipe = _remote_pipe
1682
  # For remote inference, we still need a local tokenizer for prompt compilation
1683
  self.tok = AutoTokenizer.from_pretrained(self.model_id, trust_remote_code=trust, chat_template=None)
1684
+ # We pass `token=False` to prevent from_pretrained from using a potentially invalid
1685
+ # environment token, as we only need the public tokenizer config.
1686
+ # The actual inference call uses the token provided to the InferenceClient.
1687
+ self.tok = AutoTokenizer.from_pretrained(self.model_id, trust_remote_code=trust, chat_template=None, token=False)
1688
  self.model = None # No local model needed
1689
  self.stopping_criteria = None # Not used with InferenceClient
1690
  else: