Ashendilantha commited on
Commit
f7e24e8
·
verified ·
1 Parent(s): 48ec630

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -15,7 +15,7 @@ if "device_type" not in st.session_state:
15
  # Ask user for device type
16
  device_type = st.radio("Are you using a mobile device or a PC?", ["Mobile", "PC"])
17
  st.session_state.device_type = device_type
18
- st.experimental_rerun() # Refresh the app to apply layout change
19
 
20
  # Apply the selected layout before anything else
21
  if st.session_state.device_type == "Mobile":
@@ -32,7 +32,6 @@ nltk.download('omw-1.4')
32
  news_classifier = pipeline("text-classification", model="Oneli/News_Classification")
33
  qa_pipeline = pipeline("question-answering", model="distilbert-base-cased-distilled-squad")
34
 
35
-
36
  # Label Mapping
37
  label_mapping = {
38
  "LABEL_0": "Business",
 
15
  # Ask user for device type
16
  device_type = st.radio("Are you using a mobile device or a PC?", ["Mobile", "PC"])
17
  st.session_state.device_type = device_type
18
+ st.rerun() # Corrected method for refreshing the app
19
 
20
  # Apply the selected layout before anything else
21
  if st.session_state.device_type == "Mobile":
 
32
  news_classifier = pipeline("text-classification", model="Oneli/News_Classification")
33
  qa_pipeline = pipeline("question-answering", model="distilbert-base-cased-distilled-squad")
34
 
 
35
  # Label Mapping
36
  label_mapping = {
37
  "LABEL_0": "Business",