Upload 2 files
Browse files- app.py +26 -0
- requirements.txt +5 -0
app.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
# β
Path to the preprocessed file stored on Hugging Face
|
| 5 |
+
PROCESSED_FILE_PATH = "output.xlsx" # Ensure this file is uploaded to your Hugging Face Space
|
| 6 |
+
|
| 7 |
+
# β
Function to Return Preprocessed File
|
| 8 |
+
def process_file(filepath):
|
| 9 |
+
if not filepath:
|
| 10 |
+
return "β Please upload a valid file."
|
| 11 |
+
|
| 12 |
+
# β
Return the static processed file (already stored in Hugging Face)
|
| 13 |
+
return PROCESSED_FILE_PATH
|
| 14 |
+
|
| 15 |
+
# β
Create Gradio Interface
|
| 16 |
+
iface = gr.Interface(
|
| 17 |
+
fn=process_file,
|
| 18 |
+
inputs=gr.File(type="filepath", label="π€ Upload your Excel file"),
|
| 19 |
+
outputs=gr.File(label="π₯ Download Processed File"),
|
| 20 |
+
title="DIGITAG β Intelligent Price, Seamless Label",
|
| 21 |
+
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! π"
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
# β
Launch Gradio App
|
| 25 |
+
if __name__ == "__main__":
|
| 26 |
+
iface.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
openai
|
| 2 |
+
requests
|
| 3 |
+
pandas
|
| 4 |
+
openpyxl
|
| 5 |
+
gradio
|