Commit
·
36cc19d
1
Parent(s):
0380ad0
Add application file
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio_simpletextextractfrompdf import SimpleTextExtractFromPDF
|
3 |
+
|
4 |
+
|
5 |
+
def first_200_chars(text):
|
6 |
+
return text[:200]
|
7 |
+
|
8 |
+
demo = gr.Interface(
|
9 |
+
fn=first_200_chars,
|
10 |
+
inputs=SimpleTextExtractFromPDF(label="Upload a PDF file"),
|
11 |
+
outputs="text",
|
12 |
+
title="First 200 Characters",
|
13 |
+
description="Enter some text and see the first 200 characters.",
|
14 |
+
)
|
15 |
+
|
16 |
+
demo.launch()
|