russkiyximik commited on
Commit
84bd340
·
1 Parent(s): 8aaa6f4

st tmpfile fix 2

Browse files
Files changed (1) hide show
  1. mycoder/app.py +3 -3
mycoder/app.py CHANGED
@@ -5,16 +5,16 @@ from mycoder.src.inner.main import run
5
  st.title("MyCoder Demo")
6
  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
  import tempfile
11
  with tempfile.NamedTemporaryFile(mode='wb', delete=False, 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"):
 
5
  st.title("MyCoder Demo")
6
  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
  import tempfile
11
  with tempfile.NamedTemporaryFile(mode='wb', delete=False, suffix=".csv") as temp_file:
12
+ temp_file.write(uploaded_file.getvalue())
13
  temp_file_path = temp_file.name
14
 
15
  st.success(f"File uploaded and saved as {temp_file_path}")
16
 
17
+ st.write(f"Make sure to specify the correct file name in your query, i.e. '{temp_file_path}'.")
18
  question = st.text_input("Enter your query:")
19
 
20
  if st.button("Run MyCoder Crew"):