aminaj commited on
Commit
eb3f3a7
·
verified ·
1 Parent(s): 5b906b8

Update BrainBot.py

Browse files
Files changed (1) hide show
  1. BrainBot.py +11 -11
BrainBot.py CHANGED
@@ -15,18 +15,18 @@ st.markdown(f'<style>{css}</style>', unsafe_allow_html=True)
15
  # Function to save the uploaded file as a temporary file and return its path.
16
  def save_uploaded_file(uploaded_file):
17
  st.write("Inside func")
18
- file_content = uploaded_file.read() # Load the document
19
- st.write("read file")
20
- # Create a directory if it doesn't exist
21
- data_dir = "/data"
22
- # os.makedirs(data_dir, exist_ok=True)
23
 
24
- # Create a temporary file in the data directory
25
- with tempfile.NamedTemporaryFile(delete=False, dir=data_dir) as temp_file:
26
- st.write("writing file...")
27
- temp_file.write(file_content) # Write the uploaded file content to the temporary file
28
- temp_file_path = temp_file.name # Get the path of the temporary file
29
- return temp_file_path
30
 
31
  # Function to save the uploaded image as a temporary file and return its path.
32
  def save_uploaded_image(uploaded_image):
 
15
  # Function to save the uploaded file as a temporary file and return its path.
16
  def save_uploaded_file(uploaded_file):
17
  st.write("Inside func")
18
+ # file_content = uploaded_file.read() # Load the document
19
+ # st.write("read file")
20
+ # # Create a directory if it doesn't exist
21
+ # data_dir = "/data"
22
+ # # os.makedirs(data_dir, exist_ok=True)
23
 
24
+ # # Create a temporary file in the data directory
25
+ # with tempfile.NamedTemporaryFile(delete=False, dir=data_dir) as temp_file:
26
+ # st.write("writing file...")
27
+ # temp_file.write(file_content) # Write the uploaded file content to the temporary file
28
+ # temp_file_path = temp_file.name # Get the path of the temporary file
29
+ # return temp_file_path
30
 
31
  # Function to save the uploaded image as a temporary file and return its path.
32
  def save_uploaded_image(uploaded_image):