srbhavya01 commited on
Commit
33aab2f
·
verified ·
1 Parent(s): d3412d7

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +5 -2
src/streamlit_app.py CHANGED
@@ -2,13 +2,16 @@ import streamlit as st
2
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
3
  import torch
4
 
5
- # Load model (Stable version)
6
  @st.cache_resource
7
  def load_model():
8
  tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-base")
9
  model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")
10
  return tokenizer, model
11
 
 
 
 
 
12
  # Page Config
13
 
14
  st.set_page_config(page_title="FitPlan AI - BMI Calculator", page_icon="💪")
@@ -40,7 +43,7 @@ goal = st.selectbox(
40
 
41
  equipment = st.multiselect(
42
  "Available Equipment",
43
- ["Dumbbells", "Resistance Band", "Yoga Mat", "No Equipment"]
44
  )
45
 
46
  fitness_level = st.radio(
 
2
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
3
  import torch
4
 
 
5
  @st.cache_resource
6
  def load_model():
7
  tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-base")
8
  model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")
9
  return tokenizer, model
10
 
11
+ # ⭐ MUST CALL FUNCTION
12
+ tokenizer, model = load_model()
13
+
14
+
15
  # Page Config
16
 
17
  st.set_page_config(page_title="FitPlan AI - BMI Calculator", page_icon="💪")
 
43
 
44
  equipment = st.multiselect(
45
  "Available Equipment",
46
+ ["Dumbbells", "Resistance Band", "Yoga Mat", "Skipping Rope", "Weight plates", "Cycling", "Inclined bench","Pullups Bar", "No Equipment"]
47
  )
48
 
49
  fitness_level = st.radio(