Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,12 +9,12 @@ from transformers import T5Tokenizer, T5ForConditionalGeneration
|
|
| 9 |
from sentence_transformers import SentenceTransformer
|
| 10 |
|
| 11 |
# -------------------------
|
| 12 |
-
# Step 1:
|
| 13 |
# -------------------------
|
| 14 |
def unzip_docs():
|
| 15 |
-
if os.path.exists("
|
| 16 |
-
print("🔓 Unzipping
|
| 17 |
-
with zipfile.ZipFile("
|
| 18 |
zip_ref.extractall("docs")
|
| 19 |
print("✅ Extracted to /docs")
|
| 20 |
|
|
|
|
| 9 |
from sentence_transformers import SentenceTransformer
|
| 10 |
|
| 11 |
# -------------------------
|
| 12 |
+
# Step 1: Unzip documents.zip if needed
|
| 13 |
# -------------------------
|
| 14 |
def unzip_docs():
|
| 15 |
+
if os.path.exists("documents.zip") and not os.path.exists("docs"):
|
| 16 |
+
print("🔓 Unzipping documents.zip...")
|
| 17 |
+
with zipfile.ZipFile("documents.zip", "r") as zip_ref:
|
| 18 |
zip_ref.extractall("docs")
|
| 19 |
print("✅ Extracted to /docs")
|
| 20 |
|