Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,10 +34,11 @@ def data_ingestion(filepath):
|
|
34 |
embeddings = model.encoder(**inputs).last_hidden_state.mean(dim=1).cpu().numpy()
|
35 |
return embeddings
|
36 |
|
37 |
-
db = Chroma.from_documents(texts,
|
38 |
db.persist()
|
39 |
db = None
|
40 |
|
|
|
41 |
@st.cache_resource
|
42 |
def llm_pipeline():
|
43 |
pipe = pipeline(
|
|
|
34 |
embeddings = model.encoder(**inputs).last_hidden_state.mean(dim=1).cpu().numpy()
|
35 |
return embeddings
|
36 |
|
37 |
+
db = Chroma.from_documents(texts, persist_directory="db", embedding_function=embedding_function)
|
38 |
db.persist()
|
39 |
db = None
|
40 |
|
41 |
+
|
42 |
@st.cache_resource
|
43 |
def llm_pipeline():
|
44 |
pipe = pipeline(
|