Download app.py from digitag/README: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/digitag/README/resolve/main/app.py
- Command line
-
hf download hf://spaces/digitag/README/app.py
-
curl -L -o app.py https://huggingface.co/spaces/digitag/README/resolve/main/app.py
1.08 kB
| import gradio as gr | |
| import os | |
| # β Path to the preprocessed file stored on Hugging Face | |
| PROCESSED_FILE_PATH = "output.xlsx" # Ensure this file is uploaded to your Hugging Face Space | |
| # β Function to Return Preprocessed File | |
| def process_file(filepath): | |
| if not filepath: | |
| return "β Please upload a valid file." | |
| # β Return the static processed file (already stored in Hugging Face) | |
| return PROCESSED_FILE_PATH | |
| # β Create Gradio Interface | |
| iface = gr.Interface( | |
| fn=process_file, | |
| inputs=gr.File(type="filepath", label="π€ Upload your Excel file"), | |
| outputs=gr.File(label="π₯ Download Processed File"), | |
| title="DIGITAG β Intelligent Price, Seamless Label", | |
| description="DIGITAG optimizes pricing using AI, factoring in profit margins, real product cost, expiry date, market trends, and customer behavior. Stay competitive with real-time price adjustments that boost revenue, reduce waste, and maximize profitability. Smarter pricing, better profits! π" | |
| ) | |
| # β Launch Gradio App | |
| if __name__ == "__main__": | |
| iface.launch() |