Update app.py
Browse files
app.py
CHANGED
|
@@ -48,20 +48,12 @@ embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/multi-qa-mp
|
|
| 48 |
import tempfile
|
| 49 |
tmp_dir = tempfile.mkdtemp()
|
| 50 |
|
| 51 |
-
|
| 52 |
-
faiss_index_path = hf_hub_download(
|
| 53 |
-
repo_id="SelmaNajih001/DatasetStockFAISS",
|
| 54 |
-
filename="index.faiss",
|
| 55 |
-
cache_dir=tmp_dir
|
| 56 |
-
)
|
| 57 |
-
docstore_path = hf_hub_download(
|
| 58 |
-
repo_id="SelmaNajih001/DatasetStockFAISS",
|
| 59 |
-
filename="index.pkl",
|
| 60 |
-
cache_dir=tmp_dir
|
| 61 |
-
)
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
| 65 |
|
| 66 |
|
| 67 |
def analisi_finanziaria(query, k=4):
|
|
|
|
| 48 |
import tempfile
|
| 49 |
tmp_dir = tempfile.mkdtemp()
|
| 50 |
|
| 51 |
+
local_faiss_dir = "./faiss_index"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
+
vectorstore = FAISS.load_local(
|
| 54 |
+
local_faiss_dir,
|
| 55 |
+
embeddings
|
| 56 |
+
)
|
| 57 |
|
| 58 |
|
| 59 |
def analisi_finanziaria(query, k=4):
|