testing / app.py
Mishmosh's picture
Update app.py
9abcb7b
raw
history blame
730 Bytes
import gradio as gr
# Function to handle the uploaded PDF file
def handle_uploaded_pdf(pdf_file):
# Save the uploaded PDF file for later use
pdf_file_path = "uploaded_file.pdf"
pdf_file.save(pdf_file_path)
# Print a welcome message
welcome_message = "Welcome! PDF file uploaded successfully. You can use the uploaded file later."
print(welcome_message)
# Gradio interface
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."
)
# Launch the interface
iface.launch()