Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -154,7 +154,7 @@ def extract_text_from_unstract(uploaded_file, status_box=None):
|
|
| 154 |
if status == "processed":
|
| 155 |
break
|
| 156 |
if status_box:
|
| 157 |
-
status_box.info(f"OCR in progress... ({i+1}/30)")
|
| 158 |
time.sleep(2)
|
| 159 |
else:
|
| 160 |
if status_box:
|
|
@@ -212,7 +212,7 @@ def query_gemma_llm(doc_text, checklist, agent_instruction, current_date, status
|
|
| 212 |
"max_tokens": 1024
|
| 213 |
}
|
| 214 |
if status_box:
|
| 215 |
-
status_box.info("Step 2: Validating document with
|
| 216 |
resp = requests.post(OPENROUTER_URL, headers=headers, json=data, timeout=90)
|
| 217 |
if resp.status_code != 200:
|
| 218 |
if status_box:
|
|
@@ -223,7 +223,7 @@ def query_gemma_llm(doc_text, checklist, agent_instruction, current_date, status
|
|
| 223 |
end = result.rfind("}") + 1
|
| 224 |
if start == -1 or end == 0:
|
| 225 |
if status_box:
|
| 226 |
-
status_box.error("
|
| 227 |
status_box.write(result)
|
| 228 |
return None, result, prompt
|
| 229 |
try:
|
|
@@ -295,7 +295,7 @@ def show_validation_card(result):
|
|
| 295 |
|
| 296 |
st.markdown(f"""
|
| 297 |
<div style="border-radius:16px;border:2px solid #A020F0; margin-bottom:32px; background:#f9f7ff;padding:18px 22px 22px 22px;box-shadow:0 3px 16px #0001;">
|
| 298 |
-
<div style="font-size:
|
| 299 |
<table style="width:100%;border:none;margin-bottom:12px;">
|
| 300 |
<tr>
|
| 301 |
<td style="width:40%;font-size:17px;font-weight:700;">Decision:</td>
|
|
|
|
| 154 |
if status == "processed":
|
| 155 |
break
|
| 156 |
if status_box:
|
| 157 |
+
status_box.info(f"EZOFIS AI OCR AGENT in progress... ({i+1}/30)")
|
| 158 |
time.sleep(2)
|
| 159 |
else:
|
| 160 |
if status_box:
|
|
|
|
| 212 |
"max_tokens": 1024
|
| 213 |
}
|
| 214 |
if status_box:
|
| 215 |
+
status_box.info("Step 2: Validating document with EZOFIS DOC VALIDATION AGENT...")
|
| 216 |
resp = requests.post(OPENROUTER_URL, headers=headers, json=data, timeout=90)
|
| 217 |
if resp.status_code != 200:
|
| 218 |
if status_box:
|
|
|
|
| 223 |
end = result.rfind("}") + 1
|
| 224 |
if start == -1 or end == 0:
|
| 225 |
if status_box:
|
| 226 |
+
status_box.error("Agent did not return JSON.")
|
| 227 |
status_box.write(result)
|
| 228 |
return None, result, prompt
|
| 229 |
try:
|
|
|
|
| 295 |
|
| 296 |
st.markdown(f"""
|
| 297 |
<div style="border-radius:16px;border:2px solid #A020F0; margin-bottom:32px; background:#f9f7ff;padding:18px 22px 22px 22px;box-shadow:0 3px 16px #0001;">
|
| 298 |
+
<div style="font-size:14px;font-weight:bold;letter-spacing:1px;margin-bottom:6px;">{result['File']}</div>
|
| 299 |
<table style="width:100%;border:none;margin-bottom:12px;">
|
| 300 |
<tr>
|
| 301 |
<td style="width:40%;font-size:17px;font-weight:700;">Decision:</td>
|