Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import logging
|
|
2 |
import json
|
3 |
import yaml
|
4 |
import gradio as gr
|
|
|
5 |
from pathlib import Path
|
6 |
from docling.backend.pypdfium2_backend import PyPdfiumDocumentBackend
|
7 |
from docling.datamodel.base_models import InputFormat
|
@@ -158,6 +159,7 @@ def gradio_interface(input_file):
|
|
158 |
output_files = convert_document(input_file)
|
159 |
return output_files
|
160 |
|
|
|
161 |
iface = gr.Interface(
|
162 |
fn=gradio_interface,
|
163 |
inputs=gr.File(file_count="single", type="filepath"),
|
@@ -165,7 +167,8 @@ iface = gr.Interface(
|
|
165 |
title="Document Conversion with OCR",
|
166 |
description="Upload your document or image, and get the converted output with OCR and other exports.",
|
167 |
allow_flagging="never",
|
|
|
168 |
)
|
169 |
|
170 |
if __name__ == "__main__":
|
171 |
-
iface.launch()
|
|
|
2 |
import json
|
3 |
import yaml
|
4 |
import gradio as gr
|
5 |
+
import gradio.themes as themes
|
6 |
from pathlib import Path
|
7 |
from docling.backend.pypdfium2_backend import PyPdfiumDocumentBackend
|
8 |
from docling.datamodel.base_models import InputFormat
|
|
|
159 |
output_files = convert_document(input_file)
|
160 |
return output_files
|
161 |
|
162 |
+
# Create the Gradio interface with a theme
|
163 |
iface = gr.Interface(
|
164 |
fn=gradio_interface,
|
165 |
inputs=gr.File(file_count="single", type="filepath"),
|
|
|
167 |
title="Document Conversion with OCR",
|
168 |
description="Upload your document or image, and get the converted output with OCR and other exports.",
|
169 |
allow_flagging="never",
|
170 |
+
theme=themes.Base(primary_hue="teal", secondary_hue="teal", neutral_hue="slate"), # Set the theme here
|
171 |
)
|
172 |
|
173 |
if __name__ == "__main__":
|
174 |
+
iface.launch()
|