Spaces:
Sleeping
Sleeping
Jiang Xiaolan
commited on
Commit
β’
577618a
1
Parent(s):
7332575
update
Browse files
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 |
-
|
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 |
|