Thomas Dehaene commited on
Commit
630dd76
·
1 Parent(s): 5e5e221

Update streamlit

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -3,6 +3,17 @@ from textwrap import wrap
3
  import streamlit as st
4
  from transformers import pipeline
5
  import nlpaug.augmenter.char as nac
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  st.markdown('# ByT5 Dutch OCR Corrector :pill:')
8
  st.write('This app corrects common dutch OCR mistakes, to showcase how this could be used in an OCR post-processing pipeline.')
@@ -26,6 +37,7 @@ def load_model():
26
 
27
  ocr_pipeline = load_model()
28
 
 
29
  if 'text' not in st.session_state:
30
  st.session_state.text = ""
31
 
 
3
  import streamlit as st
4
  from transformers import pipeline
5
  import nlpaug.augmenter.char as nac
6
+ import subprocess
7
+ import sys
8
+
9
+ @st.cache(allow_output_mutation=True,
10
+ suppress_st_warning=True,
11
+ show_spinner=False)
12
+ def install():
13
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "streamlit==0.89.0"])
14
+
15
+ install()
16
+
17
 
18
  st.markdown('# ByT5 Dutch OCR Corrector :pill:')
19
  st.write('This app corrects common dutch OCR mistakes, to showcase how this could be used in an OCR post-processing pipeline.')
 
37
 
38
  ocr_pipeline = load_model()
39
 
40
+
41
  if 'text' not in st.session_state:
42
  st.session_state.text = ""
43