Spaces:
Sleeping
Sleeping
jaifar530
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,7 @@ if not os.path.exists('my_authorship_model'):
|
|
47 |
r.raise_for_status()
|
48 |
|
49 |
# Debugging: Check if download is successful by examining content length
|
50 |
-
st.write(f"Downloaded model size: {len(r.content)} bytes")
|
51 |
|
52 |
# Save the downloaded content
|
53 |
with open(zip_file_path, "wb") as f:
|
@@ -55,21 +55,21 @@ if not os.path.exists('my_authorship_model'):
|
|
55 |
|
56 |
# Debugging: Verify that the zip file exists
|
57 |
if os.path.exists(zip_file_path):
|
58 |
-
st.write("Zip file exists")
|
59 |
|
60 |
# Extract the model using zipfile
|
61 |
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
|
62 |
zip_ref.extractall('my_authorship_model')
|
63 |
|
64 |
-
# Debugging: Check if the folder is successfully created
|
65 |
-
if os.path.exists('my_authorship_model'):
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
else:
|
71 |
-
|
72 |
-
|
73 |
|
74 |
else:
|
75 |
st.write("Zip file does not exist")
|
|
|
47 |
r.raise_for_status()
|
48 |
|
49 |
# Debugging: Check if download is successful by examining content length
|
50 |
+
# st.write(f"Downloaded model size: {len(r.content)} bytes")
|
51 |
|
52 |
# Save the downloaded content
|
53 |
with open(zip_file_path, "wb") as f:
|
|
|
55 |
|
56 |
# Debugging: Verify that the zip file exists
|
57 |
if os.path.exists(zip_file_path):
|
58 |
+
# st.write("Zip file exists")
|
59 |
|
60 |
# Extract the model using zipfile
|
61 |
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
|
62 |
zip_ref.extractall('my_authorship_model')
|
63 |
|
64 |
+
# # Debugging: Check if the folder is successfully created
|
65 |
+
# if os.path.exists('my_authorship_model'):
|
66 |
+
# # st.write("Model folder successfully extracted using zipfile")
|
67 |
+
# # Debugging: List the directory contents after extraction
|
68 |
+
# # st.write("Listing directory contents:")
|
69 |
+
# # st.write(os.listdir('.'))
|
70 |
+
# else:
|
71 |
+
# st.write("Model folder was not extracted successfully using zipfile")
|
72 |
+
# exit(1)
|
73 |
|
74 |
else:
|
75 |
st.write("Zip file does not exist")
|