mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-26 01:30:20 +01:00
Change fn_index in api_example_stream (#904)
This commit is contained in:
parent
461ca7faf5
commit
3850f13624
@ -12,6 +12,11 @@ import string
|
|||||||
|
|
||||||
import websockets
|
import websockets
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# to determine what value Gradio expects here.
|
||||||
|
GRADIO_FN = 8
|
||||||
|
|
||||||
|
|
||||||
def random_hash():
|
def random_hash():
|
||||||
letters = string.ascii_lowercase + string.digits
|
letters = string.ascii_lowercase + string.digits
|
||||||
@ -47,14 +52,14 @@ async def run(context):
|
|||||||
case "send_hash":
|
case "send_hash":
|
||||||
await websocket.send(json.dumps({
|
await websocket.send(json.dumps({
|
||||||
"session_hash": session,
|
"session_hash": session,
|
||||||
"fn_index": 12
|
"fn_index": GRADIO_FN
|
||||||
}))
|
}))
|
||||||
case "estimation":
|
case "estimation":
|
||||||
pass
|
pass
|
||||||
case "send_data":
|
case "send_data":
|
||||||
await websocket.send(json.dumps({
|
await websocket.send(json.dumps({
|
||||||
"session_hash": session,
|
"session_hash": session,
|
||||||
"fn_index": 12,
|
"fn_index": GRADIO_FN,
|
||||||
"data": [
|
"data": [
|
||||||
payload
|
payload
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user