Spaces:
Sleeping
Sleeping
segovia commited on
Commit ·
141799b
1
Parent(s): ce34c91
app.py
CHANGED
|
@@ -80,7 +80,7 @@ def clear_results():
|
|
| 80 |
def build_app() -> gr.Blocks:
|
| 81 |
default_model = os.getenv("OPENAI_MODEL", "gpt-4o")
|
| 82 |
|
| 83 |
-
with gr.Blocks(title="Document Parser"
|
| 84 |
gr.Markdown("# Purchase Receipt Parser\nUpload one or more files and append the extracted receipt data into the grid.")
|
| 85 |
|
| 86 |
with gr.Row():
|
|
@@ -117,11 +117,8 @@ def build_app() -> gr.Blocks:
|
|
| 117 |
return demo
|
| 118 |
|
| 119 |
|
| 120 |
-
|
| 121 |
-
|
| 122 |
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
except Exception as exc:
|
| 126 |
-
print(f"Share link unavailable ({exc}). Starting local-only Gradio app instead.")
|
| 127 |
-
build_app().launch()
|
|
|
|
| 80 |
def build_app() -> gr.Blocks:
|
| 81 |
default_model = os.getenv("OPENAI_MODEL", "gpt-4o")
|
| 82 |
|
| 83 |
+
with gr.Blocks(title="Document Parser") as demo:
|
| 84 |
gr.Markdown("# Purchase Receipt Parser\nUpload one or more files and append the extracted receipt data into the grid.")
|
| 85 |
|
| 86 |
with gr.Row():
|
|
|
|
| 117 |
return demo
|
| 118 |
|
| 119 |
|
| 120 |
+
demo = build_app()
|
| 121 |
+
|
| 122 |
|
| 123 |
+
if __name__ == "__main__":
|
| 124 |
+
demo.launch(server_name="0.0.0.0", server_port=7860, theme=gr.themes.Soft())
|
|
|
|
|
|
|
|
|