Cartinoe5930 commited on
Commit
55717b7
1 Parent(s): 42e9076

Update model_inference.py

Browse files
Files changed (1) hide show
  1. model_inference.py +3 -1
model_inference.py CHANGED
@@ -62,10 +62,12 @@ def Inference(model_list, question, API_KEY, cot, HF_TOKEN):
62
 
63
  prompt_dict, endpoint_dict = load_json("src/prompt_template.json", "src/inference_endpoint.json")
64
 
 
 
 
65
  def generate_answer(model, formatted_prompt):
66
  API_URL = endpoint_dict[model]["API_URL"]
67
  headers = endpoint_dict[model]["headers"]
68
- headers["Authorization"] += HF_TOKEN
69
  payload = {
70
  "inputs": formatted_prompt,
71
  "parameters": {
 
62
 
63
  prompt_dict, endpoint_dict = load_json("src/prompt_template.json", "src/inference_endpoint.json")
64
 
65
+ for model in model_list:
66
+ endpoint_dict[model]["headers"]["Authorization"] += HF_TOKEN
67
+
68
  def generate_answer(model, formatted_prompt):
69
  API_URL = endpoint_dict[model]["API_URL"]
70
  headers = endpoint_dict[model]["headers"]
 
71
  payload = {
72
  "inputs": formatted_prompt,
73
  "parameters": {