Update app.py
Browse files
app.py
CHANGED
@@ -10,18 +10,16 @@ import torch.nn.functional as F
|
|
10 |
from openai import AzureOpenAI
|
11 |
|
12 |
# Azure OpenAI Configuration
|
13 |
-
AZURE_OPENAI_EMBEDDING_ENDPOINT = ...
|
14 |
AZURE_API_VERSION = "2024-02-01"
|
15 |
-
AZURE_OPENAI_API_KEY = ...
|
16 |
|
17 |
# Model directory
|
18 |
-
MODEL_DIR = "
|
19 |
|
20 |
# Initialize Azure OpenAI client
|
21 |
azure_client = AzureOpenAI(
|
22 |
-
api_key=AZURE_OPENAI_API_KEY,
|
23 |
api_version=AZURE_API_VERSION,
|
24 |
-
azure_endpoint=AZURE_OPENAI_EMBEDDING_ENDPOINT
|
25 |
)
|
26 |
|
27 |
def generate_e5_embedding(text, model_name='intfloat/multilingual-e5-large'):
|
|
|
10 |
from openai import AzureOpenAI
|
11 |
|
12 |
# Azure OpenAI Configuration
|
|
|
13 |
AZURE_API_VERSION = "2024-02-01"
|
|
|
14 |
|
15 |
# Model directory
|
16 |
+
MODEL_DIR = "models"
|
17 |
|
18 |
# Initialize Azure OpenAI client
|
19 |
azure_client = AzureOpenAI(
|
20 |
+
api_key=os.getenv(AZURE_OPENAI_API_KEY),
|
21 |
api_version=AZURE_API_VERSION,
|
22 |
+
azure_endpoint=os.getenv(AZURE_OPENAI_EMBEDDING_ENDPOINT)
|
23 |
)
|
24 |
|
25 |
def generate_e5_embedding(text, model_name='intfloat/multilingual-e5-large'):
|