From 7f44cf543af6e7c7bcefb2df98cfb5bf027743a1 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Wed, 9 Oct 2024 10:34:58 +0800 Subject: [PATCH] move import positions (#2753) ### What problem does this PR solve? ### Type of change - [x] Refactoring --- rag/llm/embedding_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/llm/embedding_model.py b/rag/llm/embedding_model.py index 39704590a7..ba73cdfba8 100644 --- a/rag/llm/embedding_model.py +++ b/rag/llm/embedding_model.py @@ -18,7 +18,6 @@ import threading import requests from huggingface_hub import snapshot_download -from openai.lib.azure import AzureOpenAI from zhipuai import ZhipuAI import os from abc import ABC @@ -137,6 +136,7 @@ def encode_queries(self, text): class AzureEmbed(OpenAIEmbed): def __init__(self, key, model_name, **kwargs): + from openai.lib.azure import AzureOpenAI self.client = AzureOpenAI(api_key=key, azure_endpoint=kwargs["base_url"], api_version="2024-02-01") self.model_name = model_name