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