Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -511,17 +511,17 @@ with gr.Blocks(title="Professional Invoice Generator", css=custom_css) as demo:
|
|
| 511 |
|
| 512 |
# Upload handler: normalize audit choice to the list for detected type
|
| 513 |
def _remember_and_parse(files):
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
|
| 526 |
up.upload(
|
| 527 |
_remember_and_parse,
|
|
|
|
| 511 |
|
| 512 |
# Upload handler: normalize audit choice to the list for detected type
|
| 513 |
def _remember_and_parse(files):
|
| 514 |
+
uploaded = files[0] if isinstance(files, list) else files
|
| 515 |
+
out = on_upload(files)
|
| 516 |
+
inv_t, mods, parsed_audit = out[0], out[1], out[2]
|
| 517 |
+
normalized = _normalize_choice(inv_t, parsed_audit or "")
|
| 518 |
+
return (
|
| 519 |
+
gr.update(value=uploaded, visible=True), # <- show file
|
| 520 |
+
uploaded, # <- save to state
|
| 521 |
+
inv_t, mods, normalized,
|
| 522 |
+
out[3], out[4], out[5], out[6], out[7],
|
| 523 |
+
today_str(), "Auto"
|
| 524 |
+
)
|
| 525 |
|
| 526 |
up.upload(
|
| 527 |
_remember_and_parse,
|