|
import gradio as gr |
|
|
|
|
|
def handle_uploaded_pdf(pdf_file): |
|
|
|
pdf_file_path = "uploaded_file.pdf" |
|
pdf_file.save(pdf_file_path) |
|
|
|
|
|
welcome_message = "Welcome! PDF file uploaded successfully. You can use the uploaded file later." |
|
print(welcome_message) |
|
|
|
|
|
iface = gr.Interface( |
|
fn=handle_uploaded_pdf, |
|
inputs=gr.File(label="Upload PDF", filetype="pdf"), |
|
outputs="text", |
|
live=True, |
|
title="Welcome and PDF Upload", |
|
description="This interface prints a welcome message and allows you to upload a PDF file for later use." |
|
) |
|
|
|
|
|
iface.launch() |
|
|