mojtabaa4 commited on
Commit
8d5e3ad
1 Parent(s): 5a3afcf

add application files

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -1,10 +1,7 @@
1
  import os
2
  import gradio as gr
3
  from model.controller import Controller
4
- import patoolib
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.rar "https://drive.usercontent.google.com/download?id=1-3N-QjK6QMogy2mcNEKjTg_9yIrSjh4A&export=download&confirm=t&uuid=ceed27ad-0f81-4c16-b70f-68cebcc55279"')
18
-
19
- # Use patool to extract the .rar file
20
- patoolib.extract_archive("chromadb_collection.rar", outdir=".")
21
 
22
- # Use rarfile to extract the .rar file
23
- rarfile.UNRAR_TOOL = "unrar"
24
- with rarfile.RarFile("chromadb_collection.rar") as rf:
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')