mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-26 09:40:20 +01:00
Make api-example-stream.py functional again
This commit is contained in:
parent
3850f13624
commit
ff610b47d2
@ -15,7 +15,7 @@ import websockets
|
|||||||
# Note, Gradio may pick a different fn value as the definition of the Gradio app changes.
|
# Note, Gradio may pick a different fn value as the definition of the Gradio app changes.
|
||||||
# You can always launch the web UI and inspect the websocket stream using your browser's dev tools
|
# You can always launch the web UI and inspect the websocket stream using your browser's dev tools
|
||||||
# to determine what value Gradio expects here.
|
# to determine what value Gradio expects here.
|
||||||
GRADIO_FN = 8
|
GRADIO_FN = 29
|
||||||
|
|
||||||
|
|
||||||
def random_hash():
|
def random_hash():
|
||||||
@ -41,6 +41,10 @@ async def run(context):
|
|||||||
'length_penalty': 1,
|
'length_penalty': 1,
|
||||||
'early_stopping': False,
|
'early_stopping': False,
|
||||||
'seed': -1,
|
'seed': -1,
|
||||||
|
'add_bos_token': True,
|
||||||
|
'truncation_length': 2048,
|
||||||
|
'custom_stopping_strings': [],
|
||||||
|
'ban_eos_token': False
|
||||||
}
|
}
|
||||||
payload = json.dumps([context, params])
|
payload = json.dumps([context, params])
|
||||||
session = random_hash()
|
session = random_hash()
|
||||||
|
Loading…
Reference in New Issue
Block a user