Spaces:
Runtime error
Runtime error
add application files
Browse files
app.py
CHANGED
@@ -1,10 +1,7 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from model.controller import Controller
|
4 |
-
import
|
5 |
-
|
6 |
-
|
7 |
-
# import rarfile
|
8 |
|
9 |
# # Install unrar-free and make it available for rarfile to use
|
10 |
# os.system('apt-get update && apt-get install -y unrar-free')
|
@@ -14,15 +11,11 @@ os.chdir("/home/user/app")
|
|
14 |
|
15 |
# Download and prepare data files in the correct directory
|
16 |
os.system('wget -O processed_cases.csv "https://drive.usercontent.google.com/download?id=1jMuQtywo0mbj7ZHCCsyE8xurbSyVVCst&export=download&confirm=t&uuid=2f681c98-86f8-4159-9e03-673cdcbc7cb51"')
|
17 |
-
os.system('wget -O chromadb_collection.
|
18 |
-
|
19 |
-
# Use patool to extract the .rar file
|
20 |
-
patoolib.extract_archive("chromadb_collection.rar", outdir=".")
|
21 |
|
22 |
-
# Use
|
23 |
-
|
24 |
-
|
25 |
-
rf.extractall()
|
26 |
|
27 |
os.system('mv content/chromadb_collections chromadb_collections')
|
28 |
os.system('rm -r content')
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from model.controller import Controller
|
4 |
+
import zipfile
|
|
|
|
|
|
|
5 |
|
6 |
# # Install unrar-free and make it available for rarfile to use
|
7 |
# os.system('apt-get update && apt-get install -y unrar-free')
|
|
|
11 |
|
12 |
# Download and prepare data files in the correct directory
|
13 |
os.system('wget -O processed_cases.csv "https://drive.usercontent.google.com/download?id=1jMuQtywo0mbj7ZHCCsyE8xurbSyVVCst&export=download&confirm=t&uuid=2f681c98-86f8-4159-9e03-673cdcbc7cb51"')
|
14 |
+
os.system('wget -O chromadb_collection.zip "https://drive.usercontent.google.com/download?id=1gz5-gxSlySEtPTzL_VPQ9e8jxHFuL0ZJ&export=download&confirm=t&uuid=de946efb-47b3-435d-b432-3bd5c01c73fb"')
|
|
|
|
|
|
|
15 |
|
16 |
+
# Use zipfile to extract the .zip file
|
17 |
+
with zipfile.ZipFile("chromadb_collection.zip", 'r') as zip_ref:
|
18 |
+
zip_ref.extractall() # Extracts all files into the current directory
|
|
|
19 |
|
20 |
os.system('mv content/chromadb_collections chromadb_collections')
|
21 |
os.system('rm -r content')
|