Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +14 -8
src/streamlit_app.py
CHANGED
|
@@ -171,16 +171,22 @@ elif choose == "CNN":
|
|
| 171 |
training_file = st.file_uploader("Upload Data Training (.txt)", type=["txt"])
|
| 172 |
real_files = st.file_uploader("Upload Data Real (.txt)", type=["txt"], accept_multiple_files=True)
|
| 173 |
|
| 174 |
-
if training_file
|
| 175 |
-
#
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
| 179 |
if real_files:
|
| 180 |
for file in real_files:
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
|
|
|
|
|
|
|
|
|
| 184 |
|
| 185 |
# Parameter model
|
| 186 |
epochs = st.number_input("Jumlah Epoch", min_value=1, value=2000)
|
|
|
|
| 171 |
training_file = st.file_uploader("Upload Data Training (.txt)", type=["txt"])
|
| 172 |
real_files = st.file_uploader("Upload Data Real (.txt)", type=["txt"], accept_multiple_files=True)
|
| 173 |
|
| 174 |
+
if training_file:
|
| 175 |
+
if training_file.size > 50 * 1024 * 1024: # Batasi ukuran file <= 50MB
|
| 176 |
+
st.error("Ukuran file training melebihi 50MB!")
|
| 177 |
+
else:
|
| 178 |
+
content = training_file.read().decode("utf-8")
|
| 179 |
+
st.write("File training berhasil diupload ✅")
|
| 180 |
+
st.code(f"100 karakter pertama:\n{content[:100]}")
|
| 181 |
+
|
| 182 |
if real_files:
|
| 183 |
for file in real_files:
|
| 184 |
+
if file.size > 50 * 1024 * 1024:
|
| 185 |
+
st.error(f"File {file.name} melebihi 50MB!")
|
| 186 |
+
else:
|
| 187 |
+
content = file.read().decode("utf-8")
|
| 188 |
+
st.write(f"File {file.name} berhasil diupload ✅")
|
| 189 |
+
st.code(f"100 karakter pertama:\n{content[:100]}")
|
| 190 |
|
| 191 |
# Parameter model
|
| 192 |
epochs = st.number_input("Jumlah Epoch", min_value=1, value=2000)
|