Spaces:
Runtime error
Runtime error
add application files
Browse files- app.py +10 -4
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from model.controller import Controller
|
4 |
-
import
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
8 |
|
9 |
# Change working directory to /home/user/app
|
10 |
os.chdir("/home/user/app")
|
@@ -13,11 +16,14 @@ os.chdir("/home/user/app")
|
|
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.rar "https://drive.usercontent.google.com/download?id=1-3N-QjK6QMogy2mcNEKjTg_9yIrSjh4A&export=download&confirm=t&uuid=ceed27ad-0f81-4c16-b70f-68cebcc55279"')
|
15 |
|
|
|
|
|
|
|
16 |
# Use rarfile to extract the .rar file
|
17 |
rarfile.UNRAR_TOOL = "unrar"
|
18 |
with rarfile.RarFile("chromadb_collection.rar") as rf:
|
19 |
rf.extractall()
|
20 |
-
|
21 |
os.system('mv content/chromadb_collections chromadb_collections')
|
22 |
os.system('rm -r content')
|
23 |
|
|
|
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')
|
11 |
|
12 |
# Change working directory to /home/user/app
|
13 |
os.chdir("/home/user/app")
|
|
|
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')
|
29 |
|
requirements.txt
CHANGED
@@ -23,3 +23,4 @@ langchain_openai
|
|
23 |
sentence-transformers
|
24 |
chromadb
|
25 |
rarfile
|
|
|
|
23 |
sentence-transformers
|
24 |
chromadb
|
25 |
rarfile
|
26 |
+
patool
|