Mishmosh commited on
Commit
f5184a9
1 Parent(s): 8869d76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,12 +1,14 @@
1
  import gradio as gr
2
 
3
  def upload_file(files):
4
- file_paths = [file.name for file in files]
5
- return file_paths
 
6
 
7
  with gr.Blocks() as demo:
8
  file_output = gr.File()
9
- upload_button = gr.UploadButton("Please upload a PDF that contains an abstract. I will provide a one-sentence summary of the abstract and will say the summary out loud.", file_types=["image", "video"], file_count="multiple")
10
  upload_button.upload(upload_file, upload_button, file_output)
11
 
12
  demo.launch()
 
 
1
  import gradio as gr
2
 
3
  def upload_file(files):
4
+ # Assuming the user will upload only one PDF file, extract its name
5
+ pdf_file_path = [file.name for file in files if file.name.endswith(".pdf")]
6
+ return pdf_file_path
7
 
8
  with gr.Blocks() as demo:
9
  file_output = gr.File()
10
+ upload_button = gr.UploadButton("Please upload a PDF that contains an abstract. I will provide a one-sentence summary of the abstract and will say the summary out loud.", file_types=[".pdf"], file_count=1)
11
  upload_button.upload(upload_file, upload_button, file_output)
12
 
13
  demo.launch()
14
+