AdithyaSK commited on
Commit
94ad09c
Β·
verified Β·
1 Parent(s): 0d25ee0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -17
app.py CHANGED
@@ -25,26 +25,21 @@ load_dotenv()
25
  shared_db = lancedb.connect("~/rag_demo_db")
26
 
27
 
28
- @spaces.GPU
29
- def get_all_model():
30
- # Initialize embedding models
31
- # text_embedding_model = SentenceTransformer("all-MiniLM-L6-v2", trust_remote_code=True)
32
- text_embedding_model = SentenceTransformer(
33
- "BAAI/bge-base-en", trust_remote_code=True
34
- )
35
- # text_embedding_model = SentenceTransformer("BAAI/bge-large-en-v1.5", trust_remote_code=True)
36
- # text_embedding_model = SentenceTransformer("BAAI/bge-small-en-v1.5", trust_remote_code=True)
37
- image_embedding_model = SentenceTransformer(
38
- "jinaai/jina-clip-v1", trust_remote_code=True
39
- )
40
- colpali_model, colpali_processor = get_model_colpali("vidore/colpali-v1.2")
41
-
42
- return text_embedding_model, image_embedding_model, colpali_model, colpali_processor
43
 
44
 
45
- text_embedding_model, image_embedding_model, colpali_model, colpali_processor = (
46
- get_all_model()
 
 
47
  )
 
 
 
 
 
 
 
 
48
 
49
  # Initialize RAG instances
50
  simple_rag = SimpleRAG(
 
25
  shared_db = lancedb.connect("~/rag_demo_db")
26
 
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
 
30
+ # Initialize embedding models
31
+ # text_embedding_model = SentenceTransformer("all-MiniLM-L6-v2", trust_remote_code=True)
32
+ text_embedding_model = SentenceTransformer(
33
+ "BAAI/bge-base-en", trust_remote_code=True
34
  )
35
+ # text_embedding_model = SentenceTransformer("BAAI/bge-large-en-v1.5", trust_remote_code=True)
36
+ # text_embedding_model = SentenceTransformer("BAAI/bge-small-en-v1.5", trust_remote_code=True)
37
+ image_embedding_model = SentenceTransformer(
38
+ "jinaai/jina-clip-v1", trust_remote_code=True
39
+ )
40
+ colpali_model, colpali_processor = get_model_colpali("vidore/colpali-v1.2")
41
+
42
+
43
 
44
  # Initialize RAG instances
45
  simple_rag = SimpleRAG(