Ahmadzei commited on
Commit
29cff1e
1 Parent(s): 79abf94

update for openai

Browse files
Files changed (1) hide show
  1. backend/query_llm.py +2 -1
backend/query_llm.py CHANGED
@@ -6,6 +6,7 @@ from typing import Any, Dict, Generator, List
6
 
7
  from huggingface_hub import InferenceClient
8
  from transformers import AutoTokenizer
 
9
 
10
 
11
  OPENAI_KEY = os.getenv("OPENAI_API_KEY")
@@ -16,7 +17,7 @@ HF_CLIENT = InferenceClient(
16
  os.getenv("HF_MODEL"),
17
  token=HF_TOKEN
18
  )
19
- OAI_CLIENT = openai.Client(api_key=OPENAI_KEY)
20
 
21
  HF_GENERATE_KWARGS = {
22
  'temperature': max(float(os.getenv("TEMPERATURE", 0.9)), 1e-2),
 
6
 
7
  from huggingface_hub import InferenceClient
8
  from transformers import AutoTokenizer
9
+ from openai import OpenAI
10
 
11
 
12
  OPENAI_KEY = os.getenv("OPENAI_API_KEY")
 
17
  os.getenv("HF_MODEL"),
18
  token=HF_TOKEN
19
  )
20
+ OAI_CLIENT = OpenAI(api_key=OPENAI_KEY)
21
 
22
  HF_GENERATE_KWARGS = {
23
  'temperature': max(float(os.getenv("TEMPERATURE", 0.9)), 1e-2),