orrinin commited on
Commit
f77c387
1 Parent(s): 7ce211d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
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.gemini import Gemini
15
- from llama_index.embeddings.gemini import GeminiEmbedding
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 = Gemini(api_key=api_key, model_name="models/gemini-1.5-flash-latest")
25
- gemini_embedding_model = GeminiEmbedding(api_key=api_key, model_name="models/text-embedding-004")
 
 
 
 
 
 
26
 
27
 
28
 
29
 
30
  # Set Global settings
31
  Settings.llm = llm
32
- Settings.embed_model = gemini_embedding_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