Spaces:
Sleeping
Sleeping
OmPrakashSingh1704
commited on
Commit
•
bf24bdd
1
Parent(s):
ffb922b
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ import plotly.express as px
|
|
13 |
|
14 |
st.set_page_config(layout="wide")
|
15 |
|
16 |
-
@st.cache_resource
|
17 |
def login_huggingface(token):
|
18 |
login(token=token)
|
19 |
|
@@ -34,7 +34,7 @@ mode = st.toggle(label="MART")
|
|
34 |
if 'ind' not in st.session_state:
|
35 |
st.session_state.ind = []
|
36 |
|
37 |
-
@st.cache_resource(
|
38 |
def pygwalerapp(df):
|
39 |
return StreamlitRenderer(df)
|
40 |
def preprocess_text(text):
|
@@ -48,7 +48,7 @@ def get_recommendations(user_description, count_vectorizer, count_matrix):
|
|
48 |
cosine_similarities = cosine_similarity(user_vector, count_matrix).flatten()
|
49 |
similar_indices = cosine_similarities.argsort()[::-1]
|
50 |
return similar_indices
|
51 |
-
@st.cache_resource(
|
52 |
def show_recipe(recipe):
|
53 |
with st.spinner("HANG TIGHT, RECIPE INCOMING..."):
|
54 |
name_and_dis = f'# {recipe["name"]}\n\n'
|
@@ -73,7 +73,7 @@ def show_recipe(recipe):
|
|
73 |
with col02:
|
74 |
cont = st.container(border=True, height=500)
|
75 |
cont.write(instructions)
|
76 |
-
@st.cache_resource(
|
77 |
def cooking():
|
78 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
79 |
|
@@ -312,7 +312,7 @@ def cooking():
|
|
312 |
st.empty()
|
313 |
if st.session_state.recipe_saved == True:
|
314 |
st.success("Recipe Saved!")
|
315 |
-
@st.cache_resource(
|
316 |
def rsaved():
|
317 |
st.title("Saved Recipes")
|
318 |
def load_saved_recipes_from_pickle(directory_path):
|
@@ -356,7 +356,7 @@ def rsaved():
|
|
356 |
show_recipe(filtered_recipes[0])
|
357 |
else:
|
358 |
st.write("No recipe found.")
|
359 |
-
@st.cache_resource(
|
360 |
def mart():
|
361 |
st.markdown("# :eyes: PEOPLE SEARCHING FOR...")
|
362 |
print(st.session_state.ind)
|
|
|
13 |
|
14 |
st.set_page_config(layout="wide")
|
15 |
|
16 |
+
@st.cache_resource
|
17 |
def login_huggingface(token):
|
18 |
login(token=token)
|
19 |
|
|
|
34 |
if 'ind' not in st.session_state:
|
35 |
st.session_state.ind = []
|
36 |
|
37 |
+
@st.cache_resource(show_spinner=False)
|
38 |
def pygwalerapp(df):
|
39 |
return StreamlitRenderer(df)
|
40 |
def preprocess_text(text):
|
|
|
48 |
cosine_similarities = cosine_similarity(user_vector, count_matrix).flatten()
|
49 |
similar_indices = cosine_similarities.argsort()[::-1]
|
50 |
return similar_indices
|
51 |
+
@st.cache_resource(show_spinner=False)
|
52 |
def show_recipe(recipe):
|
53 |
with st.spinner("HANG TIGHT, RECIPE INCOMING..."):
|
54 |
name_and_dis = f'# {recipe["name"]}\n\n'
|
|
|
73 |
with col02:
|
74 |
cont = st.container(border=True, height=500)
|
75 |
cont.write(instructions)
|
76 |
+
@st.cache_resource(show_spinner=False)
|
77 |
def cooking():
|
78 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
79 |
|
|
|
312 |
st.empty()
|
313 |
if st.session_state.recipe_saved == True:
|
314 |
st.success("Recipe Saved!")
|
315 |
+
@st.cache_resource(show_spinner=False)
|
316 |
def rsaved():
|
317 |
st.title("Saved Recipes")
|
318 |
def load_saved_recipes_from_pickle(directory_path):
|
|
|
356 |
show_recipe(filtered_recipes[0])
|
357 |
else:
|
358 |
st.write("No recipe found.")
|
359 |
+
@st.cache_resource(show_spinner=False)
|
360 |
def mart():
|
361 |
st.markdown("# :eyes: PEOPLE SEARCHING FOR...")
|
362 |
print(st.session_state.ind)
|