pentagoniac commited on
Commit
481d96e
1 Parent(s): 23499f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -3,12 +3,9 @@ import gradio as gr
3
 
4
  from openai import OpenAI
5
 
6
- CLIENT = OpenAI(api_key="dummy", base_url="http://semikong.aitomatic.com:8081/v1")
7
-
8
 
9
  def http_bot(prompt, history):
10
- # Convert history to the format expected by the OpenAI API
11
- # messages = [{"role": "user" if item['is_user'] else "assistant", "content": item['content']} for item in history]
12
  messages = []
13
 
14
  # Add the current prompt to the messages
@@ -28,8 +25,8 @@ Now given an instruction from : {prompt}.
28
  Your answer: <your answer here>"""
29
  messages.append({"role": "user", "content": prompt_final})
30
 
31
- # Call the OpenAI API to generate a response
32
- response = CLIENT.chat.completions.create(
33
  model="pentagoniac/SEMIKONG-8b-GPTQ",
34
  messages=messages,
35
  # stream=True,
 
3
 
4
  from openai import OpenAI
5
 
 
 
6
 
7
  def http_bot(prompt, history):
8
+
 
9
  messages = []
10
 
11
  # Add the current prompt to the messages
 
25
  Your answer: <your answer here>"""
26
  messages.append({"role": "user", "content": prompt_final})
27
 
28
+ client = OpenAI(api_key="dummy", base_url="http://semikong.aitomatic.com:8081/v1")
29
+ response = client.chat.completions.create(
30
  model="pentagoniac/SEMIKONG-8b-GPTQ",
31
  messages=messages,
32
  # stream=True,