Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -9,6 +9,8 @@ from llama_index.tools.arxiv import ArxivToolSpec
|
|
| 9 |
from llama_index.core import Settings
|
| 10 |
from llama_index.llms.azure_openai import AzureOpenAI
|
| 11 |
from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding
|
|
|
|
|
|
|
| 12 |
from typing import Optional, List, Dict, Any
|
| 13 |
from pathlib import Path
|
| 14 |
import json
|
|
@@ -23,30 +25,9 @@ logging.basicConfig(level=logging.INFO)
|
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
-
#####
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
api_version = "2024-02-01"
|
| 30 |
-
|
| 31 |
-
llm = AzureOpenAI(
|
| 32 |
-
model="gpt-4.1",
|
| 33 |
-
deployment_name="gpt-4.1",
|
| 34 |
-
api_key=api_key,
|
| 35 |
-
azure_endpoint=azure_endpoint,
|
| 36 |
-
api_version=api_version,
|
| 37 |
-
)
|
| 38 |
-
# You need to deploy your own embedding model as well as your own chat completion model
|
| 39 |
-
embed_model = AzureOpenAIEmbedding(
|
| 40 |
-
model="text-embedding-ada-002",
|
| 41 |
-
deployment_name="text-embedding-ada-002",
|
| 42 |
-
api_key=api_key,
|
| 43 |
-
azure_endpoint=azure_endpoint,
|
| 44 |
-
api_version=api_version,
|
| 45 |
-
)
|
| 46 |
-
|
| 47 |
-
Settings.llm = llm
|
| 48 |
-
Settings.embed_model = embed_model
|
| 49 |
-
##### FIN AZURE OPENAI #####
|
| 50 |
|
| 51 |
|
| 52 |
# Configuraci贸n de paths
|
|
|
|
| 9 |
from llama_index.core import Settings
|
| 10 |
from llama_index.llms.azure_openai import AzureOpenAI
|
| 11 |
from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding
|
| 12 |
+
from llama_index.llms.openai import OpenAI
|
| 13 |
+
from llama_index.embeddings.openai import OpenAIEmbedding
|
| 14 |
from typing import Optional, List, Dict, Any
|
| 15 |
from pathlib import Path
|
| 16 |
import json
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
+
##### OPENAI #####
|
| 29 |
+
# Context:
|
| 30 |
+
exec(os.environ.get('context'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
|
| 33 |
# Configuraci贸n de paths
|