From 1bbed02a3c641f0653faf056a35ec04cb4bc84f8 Mon Sep 17 00:00:00 2001 From: csunny Date: Tue, 30 May 2023 18:55:53 +0800 Subject: [PATCH] fix: token --- pilot/model/proxy_llm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pilot/model/proxy_llm.py b/pilot/model/proxy_llm.py index 09c7a82ed..78425bd83 100644 --- a/pilot/model/proxy_llm.py +++ b/pilot/model/proxy_llm.py @@ -18,7 +18,8 @@ def proxyllm_generate_stream( stop = params.get("stop", "###") headers = { - "Authorization": "Bearer " + CFG.proxy_api_key + "Authorization": "Bearer " + CFG.proxy_api_key, + "Token": CFG.proxy_api_key } messages = prompt.split(stop) @@ -44,9 +45,13 @@ def proxyllm_generate_stream( "max_tokens": params.get("max_new_tokens"), } + print(payloads) + print(headers) res = requests.post(CFG.proxy_server_url, headers=headers, json=payloads, stream=True) text = "" + print("====================================res================") + print(res) for line in res.iter_lines(): if line: decoded_line = line.decode('utf-8')