Hrushi02 commited on
Commit
c49afbd
·
verified ·
1 Parent(s): 7d30c6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -6,7 +6,8 @@ from huggingface_hub import InferenceClient
6
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
7
  """
8
 
9
- client = InferenceClient(model="HuggingFaceH4/zephyr-7b-beta", token="HUGGINGFACEHUB_API_TOKEN")
 
10
 
11
 
12
  def respond(
@@ -85,7 +86,9 @@ base_model = AutoModelForCausalLM.from_pretrained(
85
  base_model_name,
86
  torch_dtype=torch.float16,
87
  device_map="auto",
88
- token=api_token # ✅ Pass token here
 
 
89
  )
90
 
91
  # Load fine-tuned model
 
6
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
7
  """
8
 
9
+ import os
10
+ client = InferenceClient(model="HuggingFaceH4/zephyr-7b-beta", token=os.getenv("HUGGINGFACEHUB_API_TOKEN"))
11
 
12
 
13
  def respond(
 
86
  base_model_name,
87
  torch_dtype=torch.float16,
88
  device_map="auto",
89
+ use_auth_token=api_token # ✅ Correct
90
+ )
91
+
92
  )
93
 
94
  # Load fine-tuned model