AldoOrtega commited on
Commit
d8b6898
1 Parent(s): df56fc1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -19
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import re
2
  import gradio as gr
3
- print("gradio version:", gr.__version__)
4
 
5
  import torch
6
  from transformers import DonutProcessor, VisionEncoderDecoderModel
@@ -49,21 +49,6 @@ def process_document(image):
49
  #description = "Clip AI: Check Understanding"
50
  #article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.15664' target='_blank'>Donut: OCR-free Document Understanding Transformer</a> | <a href='https://github.com/clovaai/donut' target='_blank'>Github Repo</a></p>"
51
 
52
- # Style
53
- primary_palette = gr.themes.Color(
54
- c50="#282253",
55
- c100="#282253",
56
- c200="#282253",
57
- c300="#282253",
58
- c400="#282253",
59
- c500="#282253",
60
- c600="white",
61
- c700="#EC5F9C",
62
- c800="#EC4D92",
63
- c900="#EB3A86",
64
- c950='#E9277A',
65
- )
66
-
67
  demo = gr.Interface(
68
  fn=process_document,
69
  inputs="image",
@@ -74,9 +59,7 @@ demo = gr.Interface(
74
  enable_queue=True,
75
  #examples=[["example.png"], ["example_2.png"], ["example_3.png"]],
76
  cache_examples=False,
77
- theme=gr.themes.Default(
78
- primary_hue=primary_palette
79
- ).set(body_background_fill='#F8F9FA')
80
  )
81
 
82
  demo.launch()
 
1
  import re
2
  import gradio as gr
3
+ import gradio_theme
4
 
5
  import torch
6
  from transformers import DonutProcessor, VisionEncoderDecoderModel
 
49
  #description = "Clip AI: Check Understanding"
50
  #article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.15664' target='_blank'>Donut: OCR-free Document Understanding Transformer</a> | <a href='https://github.com/clovaai/donut' target='_blank'>Github Repo</a></p>"
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  demo = gr.Interface(
53
  fn=process_document,
54
  inputs="image",
 
59
  enable_queue=True,
60
  #examples=[["example.png"], ["example_2.png"], ["example_3.png"]],
61
  cache_examples=False,
62
+ theme=gradio_theme.theme
 
 
63
  )
64
 
65
  demo.launch()