Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
| 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",
|