Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import
|
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=
|
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,
|