浏览代码

Make api-example-stream.py functional again

oobabooga 2 年之前
父节点
当前提交
ff610b47d2
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      api-example-stream.py

+ 5 - 1
api-example-stream.py

@@ -15,7 +15,7 @@ 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
+GRADIO_FN = 29
 
 
 def random_hash():
@@ -41,6 +41,10 @@ async def run(context):
         'length_penalty': 1,
         'early_stopping': False,
         'seed': -1,
+        'add_bos_token': True,
+        'truncation_length': 2048,
+        'custom_stopping_strings': [],
+        'ban_eos_token': False
     }
     payload = json.dumps([context, params])
     session = random_hash()