diff --git a/service/openai_api.py b/service/openai_api.py index 89bdba3..ebd9b4a 100644 --- a/service/openai_api.py +++ b/service/openai_api.py @@ -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)