Spaces:
Runtime error
Runtime error
add application files
Browse files- app.py +6 -5
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,10 +1,7 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from model.controller import Controller
|
4 |
-
|
5 |
-
|
6 |
-
# Install unrar and update the package list
|
7 |
-
os.system('apt-get update && apt-get install -y unrar')
|
8 |
|
9 |
# Change working directory to /home/user/app
|
10 |
os.chdir("/home/user/app")
|
@@ -12,7 +9,11 @@ os.chdir("/home/user/app")
|
|
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.rar "https://drive.usercontent.google.com/download?id=1-3N-QjK6QMogy2mcNEKjTg_9yIrSjh4A&export=download&confirm=t&uuid=ceed27ad-0f81-4c16-b70f-68cebcc55279"')
|
15 |
-
|
|
|
|
|
|
|
|
|
16 |
os.system('mv content/chromadb_collections chromadb_collections')
|
17 |
os.system('rm -r content')
|
18 |
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from model.controller import Controller
|
4 |
+
import pyrarfile
|
|
|
|
|
|
|
5 |
|
6 |
# Change working directory to /home/user/app
|
7 |
os.chdir("/home/user/app")
|
|
|
9 |
# Download and prepare data files in the correct directory
|
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 pyrarfile to extract the .rar file
|
14 |
+
with pyrarfile.RarFile("chromadb_collection.rar") as rar_ref:
|
15 |
+
rar_ref.extractall() # Extracts all files
|
16 |
+
|
17 |
os.system('mv content/chromadb_collections chromadb_collections')
|
18 |
os.system('rm -r content')
|
19 |
|
requirements.txt
CHANGED
@@ -22,3 +22,4 @@ gradio
|
|
22 |
langchain_openai
|
23 |
sentence-transformers
|
24 |
chromadb
|
|
|
|
22 |
langchain_openai
|
23 |
sentence-transformers
|
24 |
chromadb
|
25 |
+
pyrarfile
|