Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,13 +23,8 @@ def download_models():
|
|
23 |
subprocess.run(["wget", "--no-check-certificate", "https://public.ukp.informatik.tu-darmstadt.de/reimers/sentence-transformers/v0.2/clip-ViT-B-32-multilingual-v1.zip"], check=True)
|
24 |
subprocess.run(["unzip", "-q", "clip-ViT-B-32-multilingual-v1.zip", "-d", model_dir], check=True)
|
25 |
|
26 |
-
# Check if the directory exists
|
27 |
-
if not os.path.exists(model_dir):
|
28 |
-
download_models()
|
29 |
-
|
30 |
token = os.getenv('token')
|
31 |
|
32 |
-
|
33 |
@st.cache_data(show_spinner=True)
|
34 |
def load_dataset():
|
35 |
dataset = datasets.load_dataset('rjadr/ditaduranuncamais', split='train', use_auth_token=token)
|
@@ -259,6 +254,9 @@ def check_password():
|
|
259 |
return True
|
260 |
|
261 |
if check_password():
|
|
|
|
|
|
|
262 |
|
263 |
dataset = load_dataset()
|
264 |
df = load_dataframe(dataset)
|
|
|
23 |
subprocess.run(["wget", "--no-check-certificate", "https://public.ukp.informatik.tu-darmstadt.de/reimers/sentence-transformers/v0.2/clip-ViT-B-32-multilingual-v1.zip"], check=True)
|
24 |
subprocess.run(["unzip", "-q", "clip-ViT-B-32-multilingual-v1.zip", "-d", model_dir], check=True)
|
25 |
|
|
|
|
|
|
|
|
|
26 |
token = os.getenv('token')
|
27 |
|
|
|
28 |
@st.cache_data(show_spinner=True)
|
29 |
def load_dataset():
|
30 |
dataset = datasets.load_dataset('rjadr/ditaduranuncamais', split='train', use_auth_token=token)
|
|
|
254 |
return True
|
255 |
|
256 |
if check_password():
|
257 |
+
# Check if the directory exists
|
258 |
+
if not os.path.exists(model_dir):
|
259 |
+
download_models()
|
260 |
|
261 |
dataset = load_dataset()
|
262 |
df = load_dataframe(dataset)
|