Spaces:
Runtime error
Runtime error
russkiyximik commited on
Commit ·
18700aa
1
Parent(s): d2d2822
chagned tmpfile to streamlit internal option
Browse files- mycoder/app.py +7 -5
mycoder/app.py
CHANGED
|
@@ -7,12 +7,14 @@ st.write("This is a demo application for the MyCoder crew.")
|
|
| 7 |
|
| 8 |
uploaded_file = st.file_uploader("Upload a CSV file", type=["csv"])
|
| 9 |
if uploaded_file is not None:
|
| 10 |
-
|
| 11 |
-
with
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
st.write("Make sure to specify the correct file name in your query, e.g. '
|
| 16 |
question = st.text_input("Enter your query:")
|
| 17 |
|
| 18 |
if st.button("Run MyCoder Crew"):
|
|
|
|
| 7 |
|
| 8 |
uploaded_file = st.file_uploader("Upload a CSV file", type=["csv"])
|
| 9 |
if uploaded_file is not None:
|
| 10 |
+
import tempfile
|
| 11 |
+
with tempfile.NamedTemporaryFile(mode='wb', delete=True, suffix=".csv") as temp_file:
|
| 12 |
+
temp_file.write(uploaded_file.getbuffer())
|
| 13 |
+
temp_file_path = temp_file.name
|
| 14 |
+
|
| 15 |
+
st.success(f"File uploaded and saved as {temp_file_path}")
|
| 16 |
|
| 17 |
+
st.write("Make sure to specify the correct file name in your query, e.g. 'Iris.csv'.")
|
| 18 |
question = st.text_input("Enter your query:")
|
| 19 |
|
| 20 |
if st.button("Run MyCoder Crew"):
|