Spaces:
Runtime error
Runtime error
add application files
Browse files- app.py +9 -5
- requirements.txt +1 -1
app.py
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from model.controller import Controller
|
4 |
-
import
|
|
|
|
|
|
|
5 |
|
6 |
# Change working directory to /home/user/app
|
7 |
os.chdir("/home/user/app")
|
@@ -10,10 +13,11 @@ os.chdir("/home/user/app")
|
|
10 |
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"')
|
11 |
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"')
|
12 |
|
13 |
-
# Use
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
17 |
os.system('mv content/chromadb_collections chromadb_collections')
|
18 |
os.system('rm -r content')
|
19 |
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from model.controller import Controller
|
4 |
+
import rarfile
|
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')
|
8 |
|
9 |
# Change working directory to /home/user/app
|
10 |
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 |
|
requirements.txt
CHANGED
@@ -22,4 +22,4 @@ gradio
|
|
22 |
langchain_openai
|
23 |
sentence-transformers
|
24 |
chromadb
|
25 |
-
|
|
|
22 |
langchain_openai
|
23 |
sentence-transformers
|
24 |
chromadb
|
25 |
+
rarfile
|