Cartinoe5930 commited on
Commit
0072900
·
1 Parent(s): 8d98445

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -51,16 +51,16 @@ def mmlu_display_question_answer(question, cot, request: gr.Request):
51
 
52
  warmup_test = ["llama"]
53
  def warmup(model_list=warmup_test, model_inference_endpoints=inference_endpoint):
54
- for i in range(len(model_list)):
55
- API_URL = model_inference_endpoints[model_list[i]]["API_URL"]
56
- headers = model_inference_endpoints[model_list[i]]["headers"]
57
  headers["Authorization"] += HF_TOKEN
58
 
59
  def query(payload):
60
  response = requests.post(API_URL, headers=headers, json=payload)
61
  return response.json()
62
  try:
63
- output = query({
64
  "inputs": "Hello."
65
  })
66
  except:
 
51
 
52
  warmup_test = ["llama"]
53
  def warmup(model_list=warmup_test, model_inference_endpoints=inference_endpoint):
54
+ for model in model_list:
55
+ API_URL = model_inference_endpoints[model]["API_URL"]
56
+ headers = model_inference_endpoints[model]["headers"]
57
  headers["Authorization"] += HF_TOKEN
58
 
59
  def query(payload):
60
  response = requests.post(API_URL, headers=headers, json=payload)
61
  return response.json()
62
  try:
63
+ query({
64
  "inputs": "Hello."
65
  })
66
  except: