mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-12-27 06:39:33 +01:00
Do not limit API updates/second
This commit is contained in:
parent
af261e5dd4
commit
2694ef45a3
@ -93,9 +93,10 @@ def _generate_reply(question, state, stopping_strings=None, is_chat=False, escap
|
|||||||
last_update = time.time()
|
last_update = time.time()
|
||||||
yield reply
|
yield reply
|
||||||
|
|
||||||
# Limit updates to 24 or 5 per second to avoid lag
|
# Limit updates to 24 or 5 per second to avoid lag in the Gradio UI
|
||||||
|
# API updates are not limited
|
||||||
else:
|
else:
|
||||||
min_update_interval = 0.2 if (shared.args.listen or shared.args.share) else 0.0417
|
min_update_interval = 0 if not escape_html else 0.2 if (shared.args.listen or shared.args.share) else 0.0417
|
||||||
if cur_time - last_update > min_update_interval:
|
if cur_time - last_update > min_update_interval:
|
||||||
last_update = cur_time
|
last_update = cur_time
|
||||||
yield reply
|
yield reply
|
||||||
|
Loading…
Reference in New Issue
Block a user