fffiloni commited on
Commit
779f8e1
1 Parent(s): 8616e8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
  from share_btn import community_icon_html, loading_icon_html, share_js
3
-
4
  import os
5
  hf_token = os.environ.get('HF_TOKEN')
6
  from gradio_client import Client
@@ -48,7 +48,10 @@ def infer(image_input):
48
 
49
  result = get_text_after_colon(result)
50
 
51
- return result, gr.Group.update(visible=True)
 
 
 
52
 
53
  css="""
54
  #col-container {max-width: 910px; margin-left: auto; margin-right: auto;}
 
1
  import gradio as gr
2
  from share_btn import community_icon_html, loading_icon_html, share_js
3
+ import re
4
  import os
5
  hf_token = os.environ.get('HF_TOKEN')
6
  from gradio_client import Client
 
48
 
49
  result = get_text_after_colon(result)
50
 
51
+ # Use regular expressions to find new lines and insert spaces between paragraphs
52
+ new_text = re.sub(r"\n\s+", "\n \n", result)
53
+
54
+ return new_text, gr.Group.update(visible=True)
55
 
56
  css="""
57
  #col-container {max-width: 910px; margin-left: auto; margin-right: auto;}