Spaces:
Running
Running
SnJForever
commited on
Commit
•
0d66700
1
Parent(s):
c96580b
Update app.py
Browse files
app.py
CHANGED
@@ -74,9 +74,8 @@ def submit_message(type_select,user_token, prompt, prompt_template, temperature,
|
|
74 |
try:
|
75 |
if type_select=='TEXT':
|
76 |
text_history = [x for x in history if x['role'] != 'image' ]
|
77 |
-
|
78 |
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=system_prompt + text_history[-context_length*2:] + [prompt_msg], temperature=temperature, max_tokens=max_tokens)
|
79 |
-
print(prompt_msg,completion.choices[0].message.to_dict())
|
80 |
history.append(prompt_msg)
|
81 |
history.append(completion.choices[0].message.to_dict())
|
82 |
|
@@ -145,7 +144,7 @@ with gr.Blocks(css=css) as demo:
|
|
145 |
|
146 |
with gr.Column(elem_id="col-container"):
|
147 |
gr.Markdown("""## OpenAI ChatGPT chat
|
148 |
-
Using the ofiicial API (gpt-3.5-turbo model)
|
149 |
""",
|
150 |
elem_id="header")
|
151 |
|
@@ -186,5 +185,5 @@ with gr.Blocks(css=css) as demo:
|
|
186 |
|
187 |
demo.queue(concurrency_count=10)
|
188 |
demo.launch(
|
189 |
-
|
190 |
height='800px')
|
|
|
74 |
try:
|
75 |
if type_select=='TEXT':
|
76 |
text_history = [x for x in history if x['role'] != 'image' ]
|
77 |
+
|
78 |
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=system_prompt + text_history[-context_length*2:] + [prompt_msg], temperature=temperature, max_tokens=max_tokens)
|
|
|
79 |
history.append(prompt_msg)
|
80 |
history.append(completion.choices[0].message.to_dict())
|
81 |
|
|
|
144 |
|
145 |
with gr.Column(elem_id="col-container"):
|
146 |
gr.Markdown("""## OpenAI ChatGPT chat
|
147 |
+
Using the ofiicial API (gpt-3.5-turbo and DELL-E2 model)
|
148 |
""",
|
149 |
elem_id="header")
|
150 |
|
|
|
185 |
|
186 |
demo.queue(concurrency_count=10)
|
187 |
demo.launch(
|
188 |
+
auth=("admin", "IBTGeE3NrPsrViDI"),
|
189 |
height='800px')
|