|
import gradio as gr |
|
|
|
def process_input(message, pdf_file): |
|
print("Received Message:", message) |
|
print("Received PDF File:", pdf_file.name) |
|
|
|
|
|
with open("received_pdf.pdf", "wb") as output_file: |
|
output_file.write(pdf_file.read()) |
|
|
|
return "Processing complete. Check the console for details." |
|
|
|
iface = gr.Interface( |
|
fn=process_input, |
|
inputs=[ |
|
"text", |
|
gr.File( |
|
type="binary", |
|
label="Please upload a PDF file that contains an abstract. You will receive a one-sentence summary of the PDF and can listen to it.", |
|
), |
|
], |
|
outputs="text", |
|
) |
|
|
|
iface.launch() |
|
|