jost commited on
Commit
7e723b7
1 Parent(s): e4e9f4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import openai
2
  import gradio as gr
3
 
4
  anyscale_base_url = "https://api.endpoints.anyscale.com/v1"
@@ -6,7 +6,7 @@ anyscale_base_url = "https://api.endpoints.anyscale.com/v1"
6
  def chat_with_openai(api_key, user_input):
7
  prompt = f"""[INST] {user_input} [/INST]"""
8
 
9
- client = OpenAI(base_url=self.api_base, api_key=self.token)
10
  completion = client.completions.create(
11
  model="mistralai/Mixtral-8x7B-Instruct-v0.1",
12
  prompt=prompt,
 
1
+ from openai import OpenAI
2
  import gradio as gr
3
 
4
  anyscale_base_url = "https://api.endpoints.anyscale.com/v1"
 
6
  def chat_with_openai(api_key, user_input):
7
  prompt = f"""[INST] {user_input} [/INST]"""
8
 
9
+ client = OpenAI(base_url=anyscale_base_url, api_key=api_key)
10
  completion = client.completions.create(
11
  model="mistralai/Mixtral-8x7B-Instruct-v0.1",
12
  prompt=prompt,