Jiang Xiaolan commited on
Commit
577618a
β€’
1 Parent(s): 7332575
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -136,7 +136,6 @@ def clone_repo():
136
  if clone_repo():
137
  # ε…‹ιš†ζˆεŠŸεŽε―Όε…₯樑块
138
  import invoice_agent.agent as ia
139
- # from invoice_agent.agent import load_models, get_ocr_predictions, get_json_result
140
 
141
  def open_pdf(pdf_file):
142
  stream = io.BytesIO(pdf_file.getvalue())
@@ -163,8 +162,6 @@ if clone_repo():
163
 
164
  st.set_page_config(layout="wide")
165
 
166
- models = ia.load_models()
167
-
168
  st.title("""
169
  ε—ι ˜γ—γŸθ«‹ζ±‚ζ›Έγ‚’θ‡ͺε‹•γ§ι›»ε­εŒ– (Demo)
170
  """)
@@ -225,10 +222,7 @@ if clone_repo():
225
 
226
  with st.spinner('ηΎεœ¨γƒ•γ‚‘γ‚€γƒ«γ‚’θ§£ζžδΈ­γ§γ™'):
227
  # Simulate model running time
228
- # time.sleep(5) # Replace this with actual model running code
229
- # predictions = ia.get_ocr_predictions(pil_image, models)
230
- # json_predictions = ia.get_json_result(predictions)
231
- json_predictions = ia.get_json_result_v2(pil_image, models)
232
  logger.error(json_predictions)
233
  st.session_state.json_predictions = json_predictions
234
 
 
136
  if clone_repo():
137
  # ε…‹ιš†ζˆεŠŸεŽε―Όε…₯樑块
138
  import invoice_agent.agent as ia
 
139
 
140
  def open_pdf(pdf_file):
141
  stream = io.BytesIO(pdf_file.getvalue())
 
162
 
163
  st.set_page_config(layout="wide")
164
 
 
 
165
  st.title("""
166
  ε—ι ˜γ—γŸθ«‹ζ±‚ζ›Έγ‚’θ‡ͺε‹•γ§ι›»ε­εŒ– (Demo)
167
  """)
 
222
 
223
  with st.spinner('ηΎεœ¨γƒ•γ‚‘γ‚€γƒ«γ‚’θ§£ζžδΈ­γ§γ™'):
224
  # Simulate model running time
225
+ json_predictions = ia.get_json_result_v2(pil_image, None)
 
 
 
226
  logger.error(json_predictions)
227
  st.session_state.json_predictions = json_predictions
228