Spaces:
Sleeping
Sleeping
Huseyin Kir commited on
Commit ·
1f42e44
1
Parent(s): 052f966
file size logging added
Browse files- app.py +6 -0
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
import lancedb
|
| 3 |
from sentence_transformers import SentenceTransformer
|
|
@@ -14,6 +15,11 @@ index_path = snapshot_download(
|
|
| 14 |
force_download=True # ensure we get the latest version
|
| 15 |
)
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
# 2. Connect DB and load model
|
| 18 |
db = lancedb.connect(f"{index_path}/lancedb_search_index")
|
| 19 |
table = db.open_table("ndl_core_datasets")
|
|
|
|
| 1 |
+
import os
|
| 2 |
from fastapi import FastAPI
|
| 3 |
import lancedb
|
| 4 |
from sentence_transformers import SentenceTransformer
|
|
|
|
| 15 |
force_download=True # ensure we get the latest version
|
| 16 |
)
|
| 17 |
|
| 18 |
+
for root, dirs, files in os.walk(f"{index_path}/lancedb_search_index"):
|
| 19 |
+
for f in files:
|
| 20 |
+
p = os.path.join(root, f)
|
| 21 |
+
print(p, os.path.getsize(p))
|
| 22 |
+
|
| 23 |
# 2. Connect DB and load model
|
| 24 |
db = lancedb.connect(f"{index_path}/lancedb_search_index")
|
| 25 |
table = db.open_table("ndl_core_datasets")
|
requirements.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
fastapi
|
| 2 |
uvicorn
|
| 3 |
-
lancedb
|
| 4 |
sentence-transformers
|
| 5 |
pandas
|
| 6 |
huggingface-hub
|
|
|
|
| 1 |
fastapi
|
| 2 |
uvicorn
|
| 3 |
+
lancedb>=0.26.1
|
| 4 |
sentence-transformers
|
| 5 |
pandas
|
| 6 |
huggingface-hub
|