Update app.py
Browse files
app.py
CHANGED
|
@@ -5,9 +5,17 @@ from docling.document_converter import DocumentConverter
|
|
| 5 |
app = Flask(__name__)
|
| 6 |
converter = DocumentConverter()
|
| 7 |
|
| 8 |
-
@app.route('/')
|
| 9 |
-
def
|
| 10 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
@app.route('/process', methods=['POST'])
|
| 13 |
def process_document():
|
|
|
|
| 5 |
app = Flask(__name__)
|
| 6 |
converter = DocumentConverter()
|
| 7 |
|
| 8 |
+
@app.route('/', methods=['GET'])
|
| 9 |
+
def index():
|
| 10 |
+
return render_template_string('''
|
| 11 |
+
<!doctype html>
|
| 12 |
+
<title>Docling Processor</title>
|
| 13 |
+
<h1>Upload PDF to Convert to Markdown</h1>
|
| 14 |
+
<form method="post" action="/process" enctype="multipart/form-data">
|
| 15 |
+
<input type="file" name="file">
|
| 16 |
+
<input type="submit" value="Convert">
|
| 17 |
+
</form>
|
| 18 |
+
''')
|
| 19 |
|
| 20 |
@app.route('/process', methods=['POST'])
|
| 21 |
def process_document():
|