Jac-Zac commited on
Commit
7ccd814
Β·
1 Parent(s): 21fbeff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -77,9 +77,9 @@ Experimental OCR-free Document Understanding Vision Transformer, fine-tuned with
77
  with st.sidebar:
78
  information = st.radio(
79
  "Choose one predictor:",
80
- ("Low Res (1200 * 900) 5 epochs", "Mid res (1600 * 1200) 10 epochs", "Mid res (1600 * 1200) 14 epochs"),
81
  )
82
- image_choice = st.selectbox("Pick one πŸ“‘", ["1", "2", "3"], index=0)
83
  uploaded_file = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
84
 
85
  st.text(
@@ -148,6 +148,17 @@ if st.button("Parse sample! 🐍"):
148
  use_auth_token=os.environ["TOKEN"],
149
  )
150
 
 
 
 
 
 
 
 
 
 
 
 
151
 
152
  # this is the same for both models
153
  task_prompt = f"<s_herbarium>"
 
77
  with st.sidebar:
78
  information = st.radio(
79
  "Choose one predictor:",
80
+ ("Low Res (1200 * 900) 5 epochs", "Mid res (1600 * 1200) 10 epochs", "Mid res (1600 * 1200) 14 epochs"), "Mid res new 0 epoch"
81
  )
82
+ image_choice = st.selectbox("Pick one πŸ“‘", ["1", "2", "3","4"], index=0)
83
  uploaded_file = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
84
 
85
  st.text(
 
148
  use_auth_token=os.environ["TOKEN"],
149
  )
150
 
151
+ elif information == "Mid res new 0 epoch":
152
+ processor = DonutProcessor.from_pretrained(
153
+ "Jac-Zac/thesis_test_donut",
154
+ revision="4d64fa9a156908aa3df0e0e39463d401528a15c9",
155
+ use_auth_token=os.environ["TOKEN"],
156
+ )
157
+ pretrained_model = VisionEncoderDecoderModel.from_pretrained(
158
+ "Jac-Zac/thesis_test_donut",
159
+ revision="4d64fa9a156908aa3df0e0e39463d401528a15c9",
160
+ use_auth_token=os.environ["TOKEN"],
161
+ )
162
 
163
  # this is the same for both models
164
  task_prompt = f"<s_herbarium>"