From aa58d79b772cb4923a4233effffa164b16cd99b8 Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Wed, 8 Nov 2023 18:06:01 +0800 Subject: [PATCH] fix gradio version and add concurrency control --- examples/apps/llm_riddles/app.py | 5 +++-- examples/apps/llm_riddles/requirements.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/apps/llm_riddles/app.py b/examples/apps/llm_riddles/app.py index 136ab718..348e4bd8 100644 --- a/examples/apps/llm_riddles/app.py +++ b/examples/apps/llm_riddles/app.py @@ -94,7 +94,7 @@ def generate_response(input, model_name): return model(input) except RuntimeError as e: # if exception happens, print error in log and return empty str - print(e) + print('error', e) return '' @@ -143,4 +143,5 @@ with block as demo: inputs=[message, state], outputs=[challenge_result, chatbot, question_info, challenge_info]) -demo.queue().launch(height=800, share=True) +demo.queue(concurrency_count=10).launch( + height=800, share=True, concurrency_limit=10) diff --git a/examples/apps/llm_riddles/requirements.txt b/examples/apps/llm_riddles/requirements.txt index 371f609b..76c33f1b 100644 --- a/examples/apps/llm_riddles/requirements.txt +++ b/examples/apps/llm_riddles/requirements.txt @@ -1,3 +1,3 @@ dashscope -gradio +gradio==3.39.0 sympy