Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,6 +31,12 @@ model_name = "model-q4_K.gguf"
|
|
31 |
final_model_path = os.path.join(directory, model_name)
|
32 |
|
33 |
print("Downloading all files...")
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
if not os.path.exists(final_model_path):
|
35 |
with open(final_model_path, "wb") as f:
|
36 |
http_get(model_url, f)
|
|
|
31 |
final_model_path = os.path.join(directory, model_name)
|
32 |
|
33 |
print("Downloading all files...")
|
34 |
+
rm_files = [os.path.join(directory, f) for f in os.listdir(directory)]
|
35 |
+
for f in rm_files:
|
36 |
+
if os.path.isfile(f):
|
37 |
+
os.remove(f)
|
38 |
+
else:
|
39 |
+
shutil.rmtree(f)
|
40 |
if not os.path.exists(final_model_path):
|
41 |
with open(final_model_path, "wb") as f:
|
42 |
http_get(model_url, f)
|