Update app.py
Browse files
app.py
CHANGED
@@ -11,8 +11,8 @@ from llama_index.vector_stores.chroma import ChromaVectorStore
|
|
11 |
|
12 |
import chromadb
|
13 |
import re
|
14 |
-
from llama_index.llms.
|
15 |
-
from llama_index.embeddings.
|
16 |
|
17 |
from llama_index.core import PromptTemplate
|
18 |
from llama_index.core.llms import ChatMessage
|
@@ -20,16 +20,23 @@ import gradio as gr
|
|
20 |
import uuid
|
21 |
|
22 |
api_key = os.environ.get("API_KEY")
|
|
|
23 |
|
24 |
-
llm =
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
# Set Global settings
|
31 |
Settings.llm = llm
|
32 |
-
Settings.embed_model =
|
33 |
|
34 |
db_path=""
|
35 |
|
|
|
11 |
|
12 |
import chromadb
|
13 |
import re
|
14 |
+
from llama_index.llms.cohere import Cohere
|
15 |
+
from llama_index.embeddings.cohere import CohereEmbedding
|
16 |
|
17 |
from llama_index.core import PromptTemplate
|
18 |
from llama_index.core.llms import ChatMessage
|
|
|
20 |
import uuid
|
21 |
|
22 |
api_key = os.environ.get("API_KEY")
|
23 |
+
base_url = os.environ.get("BASE_URL")
|
24 |
|
25 |
+
llm = Cohere(
|
26 |
+
api_key=api_key,
|
27 |
+
model_name="command")
|
28 |
+
embedding_model = CohereEmbedding(
|
29 |
+
api_key=api_key,
|
30 |
+
model_name="embed-multilingual-v3.0",
|
31 |
+
input_type="search_query",
|
32 |
+
embedding_type="int8",)
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
# Set Global settings
|
38 |
Settings.llm = llm
|
39 |
+
Settings.embed_model = embedding_model
|
40 |
|
41 |
db_path=""
|
42 |
|