Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SonyShrestha committed May 24, 2024
2 parents 8f02f5d + ba1e93e commit 2ea3a0d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Website/pages/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pages.feature_1 import show_feature1
from pages.feature_2 import show_feature2
from pages.feature_3 import show_feature3
from pages.feature_4 import show_feature4
from pages.product_preishability import show_feature1
from pages.cust_purchase_expected_expiry import show_feature2
from pages.food_recommender import show_feature3
from pages.sentiment_analysis import show_feature4
from pages.dynamic_pricing_streamlit import dynamic_pricing_streamlit
from pages.closest_supermarket import main
10 changes: 7 additions & 3 deletions Website/pages/feature_3.py → Website/pages/food_recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
# Set page config for a better appearance
st.set_page_config(page_title="Food Recommender System", layout="wide")



def create_spark_session():
spark = SparkSession.builder \
.appName("Feature 3") \
.appName("RecipeProcessing") \
.config("spark.driver.host", "127.0.0.1") \
.config("spark.executorEnv.PYSPARK_PYTHON", "/home/pce/anaconda3/envs/spark_env/bin/python3.11") \
.config("spark.yarn.appMasterEnv.PYSPARK_PYTHON", "/home/pce/anaconda3/envs/spark_env/bin/python3.11") \
.config("spark.hadoop.fs.gs.impl", "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem") \
.config("spark.hadoop.fs.AbstractFileSystem.gs.impl", "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFS") \
.config("spark.hadoop.google.cloud.auth.service.account.enable", "true") \
Expand Down Expand Up @@ -82,7 +86,7 @@ def find_or_generate_recipes(processed_df, ingredients):
return [{"generated_recipe": generated_recipe}]

def initialize():
input_path = "gs://spicy_1/mealdb_20240407221823.parquet"
input_path = "gs://spicy_1/mealdb_20240521004240.parquet"
processed_df = preprocess_data(input_path)
return processed_df

Expand Down Expand Up @@ -124,4 +128,4 @@ def initialize():
<div class="footer">
<p>Developed by SpicyBytes</p>
</div>
""", unsafe_allow_html=True)
""", unsafe_allow_html=True)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@st.cache_data
def load_data_from_gcs(filepath):
spark = SparkSession.builder \
.appName("Feature 4") \
.appName("GCS Connection") \
.config("spark.jars.packages", "com.google.cloud.bigdataoss:gcs-connector:hadoop3-2.2.2") \
.config("fs.gs.impl", "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem") \
.config("fs.AbstractFileSystem.gs.impl", "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFS") \
Expand Down Expand Up @@ -124,4 +124,4 @@ def display_reviews(df):
<div class="footer">
<p>Developed by SpicyBytes</p>
</div>
""", unsafe_allow_html=True)
""", unsafe_allow_html=True)

0 comments on commit 2ea3a0d

Please sign in to comment.