避免websocket连接关闭时报错

master
落雨楓 2 years ago
parent 2bd8a2462a
commit 7a3ad2afbc

@ -93,7 +93,6 @@ class OpenAIApi:
else:
post_data["model"] = "text-embedding-ada-002"
if self.api_type == "azure":
# Azure api does not support batch
for index, text in enumerate(text_list):
@ -156,6 +155,7 @@ class OpenAIApi:
token_usage = int(data["usage"]["total_tokens"])
if on_index_progress is not None:
await on_index_progress(index, len(text_list))
return (doc_list, token_usage)

Loading…
Cancel
Save