Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Disabled empty messages And increase threads
Browse files
app.py
CHANGED
@@ -33,6 +33,8 @@ def model_chat(query: Optional[str], history: Optional[History]) -> Generator[Tu
|
|
33 |
query = ''
|
34 |
if history is None:
|
35 |
history = []
|
|
|
|
|
36 |
messages = history_to_messages(history)
|
37 |
messages.append({'role': 'user', 'content': query.strip()})
|
38 |
gen = oai_client.chat.completions.create(
|
@@ -118,4 +120,4 @@ with gr.Blocks(css='''
|
|
118 |
|
119 |
|
120 |
|
121 |
-
demo.queue(api_open=False).launch(max_threads=
|
|
|
33 |
query = ''
|
34 |
if history is None:
|
35 |
history = []
|
36 |
+
if not query.strip():
|
37 |
+
return
|
38 |
messages = history_to_messages(history)
|
39 |
messages.append({'role': 'user', 'content': query.strip()})
|
40 |
gen = oai_client.chat.completions.create(
|
|
|
120 |
|
121 |
|
122 |
|
123 |
+
demo.queue(api_open=False).launch(max_threads=20, share=True, allowed_paths=['dicta-logo.jpg'])
|