NeonBohdan commited on
Commit
5b981d0
1 Parent(s): a3e95e6

client -> openai

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. shared.py +2 -2
app.py CHANGED
@@ -59,7 +59,7 @@ def respond(
59
 
60
  messages.append({"role": "user", "content": message})
61
 
62
- completion = client.client.chat.completions.create(
63
  model=client.vllm_model_name,
64
  messages=messages,
65
  max_tokens=max_tokens,
 
59
 
60
  messages.append({"role": "user", "content": message})
61
 
62
+ completion = client.openai.chat.completions.create(
63
  model=client.vllm_model_name,
64
  messages=messages,
65
  max_tokens=max_tokens,
shared.py CHANGED
@@ -51,13 +51,13 @@ class Client:
51
  self.get_personas()
52
 
53
  def init_client(self):
54
- self.client = OpenAI(
55
  base_url=f"{self.api_url}/v1",
56
  api_key=self.api_key,
57
  )
58
 
59
  def get_metadata(self):
60
- models = self.client.models.list()
61
  vllm_model_name = models.data[0].id
62
 
63
  model_name, *suffix = vllm_model_name.split("@")
 
51
  self.get_personas()
52
 
53
  def init_client(self):
54
+ self.openai = OpenAI(
55
  base_url=f"{self.api_url}/v1",
56
  api_key=self.api_key,
57
  )
58
 
59
  def get_metadata(self):
60
+ models = self.openai.models.list()
61
  vllm_model_name = models.data[0].id
62
 
63
  model_name, *suffix = vllm_model_name.split("@")