syeda-Rija20 commited on
Commit
02c029e
ยท
verified ยท
1 Parent(s): eda67f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -77,7 +77,7 @@ import requests
77
  @st.cache_resource
78
  def load_image_model():
79
 
80
- url = "url = "https://huggingface.co/syeda-Rija20/image-detector/resolve/main/image_detector_finetuned.h5""
81
 
82
  model_path = "image_model.h5"
83
 
@@ -109,12 +109,7 @@ def predict_news(text):
109
 
110
  return prediction, confidence
111
 
112
- # ---------------------------
113
- with st.spinner("Loading models... โณ Please wait"):
114
- tokenizer, text_model = load_text_model()
115
- image_model = load_image_model()
116
 
117
- st.success("Models Loaded Successfully โœ…")
118
  # TABS
119
  # ---------------------------
120
  tab1, tab2 = st.tabs(["๐Ÿ“ฐ Fake News Detection", "๐Ÿ–ผ๏ธ AI Image Detection"])
@@ -124,7 +119,8 @@ tab1, tab2 = st.tabs(["๐Ÿ“ฐ Fake News Detection", "๐Ÿ–ผ๏ธ AI Image Detection"])
124
  # ===========================
125
  with tab1:
126
  st.subheader("๐Ÿ“ฐ Fake News Detector")
127
-
 
128
  user_input = st.text_area("Paste news article here...")
129
 
130
  if st.button("๐Ÿ” Analyze News"):
@@ -145,6 +141,8 @@ with tab1:
145
  # ===========================
146
  with tab2:
147
  st.subheader("๐Ÿ–ผ๏ธ AI Image Detector")
 
 
148
 
149
  uploaded_file = st.file_uploader("Upload Image", type=["jpg", "png", "jpeg"])
150
 
 
77
  @st.cache_resource
78
  def load_image_model():
79
 
80
+ url ="https://huggingface.co/syeda-Rija20/image-detector/resolve/main/image_detector_finetuned.h5"
81
 
82
  model_path = "image_model.h5"
83
 
 
109
 
110
  return prediction, confidence
111
 
 
 
 
 
112
 
 
113
  # TABS
114
  # ---------------------------
115
  tab1, tab2 = st.tabs(["๐Ÿ“ฐ Fake News Detection", "๐Ÿ–ผ๏ธ AI Image Detection"])
 
119
  # ===========================
120
  with tab1:
121
  st.subheader("๐Ÿ“ฐ Fake News Detector")
122
+ with st.spinner("Loading text model... โณ"):
123
+ tokenizer, text_model = load_text_model()
124
  user_input = st.text_area("Paste news article here...")
125
 
126
  if st.button("๐Ÿ” Analyze News"):
 
141
  # ===========================
142
  with tab2:
143
  st.subheader("๐Ÿ–ผ๏ธ AI Image Detector")
144
+ with st.spinner("Loading image model... โณ"):
145
+ image_model = load_image_model()
146
 
147
  uploaded_file = st.file_uploader("Upload Image", type=["jpg", "png", "jpeg"])
148