File size: 628 Bytes
cb1f0f5 d76bc23 2f5a6c0 c349cca d76bc23 dbbb3fc d76bc23 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import gradio as gr
# Function to process the input message and PDF file
def process_input(message, pdf_file):
# Save the uploaded PDF file
pdf_file.save("uploaded_pdf.pdf")
# Process the message and return a result
result = f"Message: {message}\nPDF file uploaded successfully!"
return result
# Gradio interface
iface = gr.Interface(
fn=process_input,
inputs=[
gr.inputs.Textbox(label="Enter your message"),
gr.inputs.File(label="Upload a PDF file", type="file", accept=".pdf")
],
outputs=gr.outputs.Textbox(label="Result")
)
# Launch the Gradio interface
iface.launch()
|