Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,6 @@
|
|
81 |
import gradio as gr
|
82 |
import requests
|
83 |
import openai
|
84 |
-
import json
|
85 |
import os
|
86 |
|
87 |
def function(Textbox,Textbox2,Textbox3):
|
@@ -92,12 +91,14 @@ def function(Textbox,Textbox2,Textbox3):
|
|
92 |
# model = os.environ.get("model")
|
93 |
# hrc = os.environ.get("hrc")
|
94 |
if Textbox3 == target:
|
95 |
-
|
|
|
|
|
96 |
messages = [
|
97 |
{"role": "system", "content": content},
|
98 |
]
|
99 |
messages.append(
|
100 |
-
|
101 |
)
|
102 |
chat = openai.ChatCompletion.create(
|
103 |
model="gpt-3.5-turbo", messages=messages
|
|
|
81 |
import gradio as gr
|
82 |
import requests
|
83 |
import openai
|
|
|
84 |
import os
|
85 |
|
86 |
def function(Textbox,Textbox2,Textbox3):
|
|
|
91 |
# model = os.environ.get("model")
|
92 |
# hrc = os.environ.get("hrc")
|
93 |
if Textbox3 == target:
|
94 |
+
Textbox2 = Textbox2.replace("[", "").replace("]", "").replace("'", "")
|
95 |
+
Textbox2 = Textbox2.split(",")
|
96 |
+
Textbox2_edited = [x.strip() for x in Textbox2]
|
97 |
messages = [
|
98 |
{"role": "system", "content": content},
|
99 |
]
|
100 |
messages.append(
|
101 |
+
Textbox2_edited
|
102 |
)
|
103 |
chat = openai.ChatCompletion.create(
|
104 |
model="gpt-3.5-turbo", messages=messages
|