mcikalmerdeka commited on
Commit
d7b6e8a
Β·
1 Parent(s): e485dfd

refactor Gradio interface to remove redundant theme specification and clean up Textbox components

Browse files
Files changed (2) hide show
  1. main.py +2 -1
  2. src/interface.py +3 -5
main.py CHANGED
@@ -28,7 +28,8 @@ def main():
28
  server_name="0.0.0.0",
29
  server_port=7860,
30
  share=False,
31
- show_error=True
 
32
  )
33
 
34
  if __name__ == "__main__":
 
28
  server_name="0.0.0.0",
29
  server_port=7860,
30
  share=False,
31
+ show_error=True,
32
+ theme=gr.themes.Soft()
33
  )
34
 
35
  if __name__ == "__main__":
src/interface.py CHANGED
@@ -160,7 +160,7 @@ def create_interface():
160
  if f.lower().endswith(('.png', '.jpg', '.jpeg', '.webp')):
161
  examples.append(os.path.join(examples_dir, f))
162
 
163
- with gr.Blocks(title="Unified OCR Platform", theme=gr.themes.Soft()) as demo:
164
  gr.Markdown("""
165
  # πŸš€ Unified OCR Platform
166
 
@@ -253,8 +253,7 @@ def create_interface():
253
  with gr.Tab("πŸ“ Text"):
254
  text_output = gr.Textbox(
255
  label="Extracted Text",
256
- lines=20,
257
- show_copy_button=True
258
  )
259
 
260
  with gr.Tab("πŸ“„ Markdown"):
@@ -273,8 +272,7 @@ def create_interface():
273
  with gr.Tab("πŸ”§ Raw"):
274
  raw_output = gr.Textbox(
275
  label="Raw Output",
276
- lines=20,
277
- show_copy_button=True
278
  )
279
 
280
  # Info section
 
160
  if f.lower().endswith(('.png', '.jpg', '.jpeg', '.webp')):
161
  examples.append(os.path.join(examples_dir, f))
162
 
163
+ with gr.Blocks(title="Unified OCR Platform") as demo:
164
  gr.Markdown("""
165
  # πŸš€ Unified OCR Platform
166
 
 
253
  with gr.Tab("πŸ“ Text"):
254
  text_output = gr.Textbox(
255
  label="Extracted Text",
256
+ lines=20
 
257
  )
258
 
259
  with gr.Tab("πŸ“„ Markdown"):
 
272
  with gr.Tab("πŸ”§ Raw"):
273
  raw_output = gr.Textbox(
274
  label="Raw Output",
275
+ lines=20
 
276
  )
277
 
278
  # Info section