fix: token

This commit is contained in:
csunny 2023-05-30 18:55:53 +08:00
parent 00b2671c0a
commit 1bbed02a3c

View File

@ -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')