Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,10 +4,10 @@ import pandas as pd
|
|
| 4 |
import numpy as np
|
| 5 |
import pickle
|
| 6 |
import datetime
|
| 7 |
-
import os
|
| 8 |
-
import sys
|
| 9 |
# from utils import payday, date_extracts
|
| 10 |
-
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
| 11 |
|
| 12 |
from utils import payday, date_extracts
|
| 13 |
|
|
@@ -23,11 +23,11 @@ st.set_page_config(
|
|
| 23 |
}
|
| 24 |
)
|
| 25 |
|
| 26 |
-
# Define directory paths
|
| 27 |
-
DIRPATH = os.path.dirname(os.path.realpath(__file__))
|
| 28 |
-
ml_components_1 = os.path.join(DIRPATH, "..", "src", "assets", "ml_components", "ml_components_1.pkl")
|
| 29 |
-
ml_components_2 = os.path.join(DIRPATH, "..", "src", "assets", "ml_components", "ml_components_2.pkl")
|
| 30 |
-
image_path = os.path.join(DIRPATH, "..", "src", "assets", "images", "sales.png")
|
| 31 |
|
| 32 |
|
| 33 |
# create a functions to load pickle file.
|
|
@@ -38,8 +38,8 @@ def load_pickle(filename):
|
|
| 38 |
|
| 39 |
|
| 40 |
#load all pickle files
|
| 41 |
-
ml_compos_1 = load_pickle(ml_components_1)
|
| 42 |
-
ml_compos_2 = load_pickle(ml_components_2)
|
| 43 |
|
| 44 |
# components in ml_compos_2
|
| 45 |
categorical_pipeline = ml_compos_2['categorical_pipeline']
|
|
@@ -54,7 +54,7 @@ cat_cols = ml_compos_1['cat_cols']
|
|
| 54 |
st.title('✨SALES FORECASTING APP✨')
|
| 55 |
|
| 56 |
# adding image
|
| 57 |
-
image=Image.open(
|
| 58 |
st.image(image, width=600)
|
| 59 |
|
| 60 |
|
|
|
|
| 4 |
import numpy as np
|
| 5 |
import pickle
|
| 6 |
import datetime
|
| 7 |
+
# import os
|
| 8 |
+
# import sys
|
| 9 |
# from utils import payday, date_extracts
|
| 10 |
+
# sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
| 11 |
|
| 12 |
from utils import payday, date_extracts
|
| 13 |
|
|
|
|
| 23 |
}
|
| 24 |
)
|
| 25 |
|
| 26 |
+
# # Define directory paths
|
| 27 |
+
# DIRPATH = os.path.dirname(os.path.realpath(__file__))
|
| 28 |
+
# ml_components_1 = os.path.join(DIRPATH, "..", "src", "assets", "ml_components", "ml_components_1.pkl")
|
| 29 |
+
# ml_components_2 = os.path.join(DIRPATH, "..", "src", "assets", "ml_components", "ml_components_2.pkl")
|
| 30 |
+
# image_path = os.path.join(DIRPATH, "..", "src", "assets", "images", "sales.png")
|
| 31 |
|
| 32 |
|
| 33 |
# create a functions to load pickle file.
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
#load all pickle files
|
| 41 |
+
ml_compos_1 = load_pickle('ml_components_1.pkl')
|
| 42 |
+
ml_compos_2 = load_pickle('ml_components_2.pkl')
|
| 43 |
|
| 44 |
# components in ml_compos_2
|
| 45 |
categorical_pipeline = ml_compos_2['categorical_pipeline']
|
|
|
|
| 54 |
st.title('✨SALES FORECASTING APP✨')
|
| 55 |
|
| 56 |
# adding image
|
| 57 |
+
image=Image.open('sales.png')
|
| 58 |
st.image(image, width=600)
|
| 59 |
|
| 60 |
|