wasmdashai commited on
Commit
4f394eb
·
verified ·
1 Parent(s): 7d54bec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -1,3 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
1
  def save_file(file):
2
  # Get the file name
3
  file_name = file.name
@@ -17,4 +28,4 @@ iface = gr.Interface(
17
  )
18
 
19
  # Launch the app
20
- iface.launch()
 
1
+ import os
2
+ import gradio as gr
3
+
4
+ # Define the folder where uploaded files will be saved
5
+ upload_folder = "uploaded_files"
6
+
7
+ # Ensure the folder exists; if not, create it
8
+ if not os.path.exists(upload_folder):
9
+ os.makedirs(upload_folder)
10
+
11
+ # Function to handle the file upload
12
  def save_file(file):
13
  # Get the file name
14
  file_name = file.name
 
28
  )
29
 
30
  # Launch the app
31
+ iface.launch()