Spaces:
Runtime error
Runtime error
Commit
•
e28fc91
1
Parent(s):
472a486
Update app.py (#3)
Browse files- Update app.py (4a5059070f83519da16a68fa533795b291a6309b)
Co-authored-by: Marcelo Moreno <marcelomoreno26@users.noreply.huggingface.co>
app.py
CHANGED
@@ -4,6 +4,11 @@ import streamlit as st
|
|
4 |
import pandas as pd
|
5 |
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
def main():
|
9 |
# Load models
|
@@ -22,9 +27,10 @@ def main():
|
|
22 |
"Example 2": "example2.zip",
|
23 |
"Example 3": "example3.zip"
|
24 |
}
|
|
|
25 |
for name, file in example_files.items():
|
26 |
-
|
27 |
-
|
28 |
|
29 |
|
30 |
# File uploader
|
|
|
4 |
import pandas as pd
|
5 |
|
6 |
|
7 |
+
@st.cache_data
|
8 |
+
def load_example_file(file):
|
9 |
+
with open(file, "rb") as f:
|
10 |
+
return f.read()
|
11 |
+
|
12 |
|
13 |
def main():
|
14 |
# Load models
|
|
|
27 |
"Example 2": "example2.zip",
|
28 |
"Example 3": "example3.zip"
|
29 |
}
|
30 |
+
|
31 |
for name, file in example_files.items():
|
32 |
+
data = load_example_file(file)
|
33 |
+
st.download_button(label=name, data=data, file_name=file, mime="application/zip")
|
34 |
|
35 |
|
36 |
# File uploader
|