luminoussg commited on
Commit
5ae8c76
·
verified ·
1 Parent(s): cf38aa5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -15,12 +15,12 @@ MODEL_ENDPOINTS = {
15
  def query_model(prompt, model_endpoint):
16
  """
17
  Query a specific model using OpenAI-compatible ChatCompletion.
18
- Since the Hugging Face Inference API is OpenAI-compatible here,
19
- we just set openai.api_base to the model's endpoint.
20
  """
21
  openai.api_key = HF_API_KEY
22
  openai.api_base = model_endpoint
23
-
24
  response = openai.ChatCompletion.create(
25
  model="placeholder-model",
26
  messages=[{"role": "user", "content": prompt}],
 
15
  def query_model(prompt, model_endpoint):
16
  """
17
  Query a specific model using OpenAI-compatible ChatCompletion.
18
+ Since the Hugging Face Inference API is OpenAI-compatible,
19
+ we set openai.api_base to the model's endpoint.
20
  """
21
  openai.api_key = HF_API_KEY
22
  openai.api_base = model_endpoint
23
+
24
  response = openai.ChatCompletion.create(
25
  model="placeholder-model",
26
  messages=[{"role": "user", "content": prompt}],