Shaltiel commited on
Commit
714e21b
1 Parent(s): 8038eb6

Disabled empty messages And increase threads

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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=10, share=False, allowed_paths=['dicta-logo.jpg'])
 
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'])