Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -257,17 +257,17 @@ def main():
|
|
257 |
)
|
258 |
|
259 |
# Language detection settings
|
260 |
-
st.sidebar.markdown("---")
|
261 |
-
st.sidebar.subheader("🔍 Language Detection")
|
262 |
-
auto_detect = st.sidebar.checkbox("Auto-detect input language", value=True)
|
263 |
-
|
264 |
-
if not auto_detect:
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
|
272 |
# Load the selected emotion classifier
|
273 |
emotion_classifier = load_emotion_classifier(selected_model_key)
|
@@ -303,8 +303,8 @@ def main():
|
|
303 |
# Language Detection
|
304 |
if auto_detect:
|
305 |
detected_language = detect_language(user_input)
|
306 |
-
else:
|
307 |
-
|
308 |
|
309 |
# Display language detection results
|
310 |
display_language_info(detected_language)
|
@@ -358,8 +358,8 @@ def main():
|
|
358 |
dominant_emotion = max(emotion_predictions, key=lambda x: x['score'])
|
359 |
language_name = get_language_name(detected_language)
|
360 |
|
361 |
-
st.markdown(f"**Responding with:** {dominant_emotion['label'].title()} emotion in {language_name}")
|
362 |
-
st.markdown("---")
|
363 |
|
364 |
# Display the response in a nice container
|
365 |
with st.container():
|
|
|
257 |
)
|
258 |
|
259 |
# Language detection settings
|
260 |
+
#st.sidebar.markdown("---")
|
261 |
+
#st.sidebar.subheader("🔍 Language Detection")
|
262 |
+
#auto_detect = st.sidebar.checkbox("Auto-detect input language", value=True)
|
263 |
+
auto_detect=True
|
264 |
+
#if not auto_detect:
|
265 |
+
# manual_language = st.sidebar.selectbox(
|
266 |
+
# "Select input language manually:",
|
267 |
+
# list(SUPPORTED_LANGUAGES.keys()),
|
268 |
+
# format_func=lambda x: SUPPORTED_LANGUAGES[x],
|
269 |
+
# index=0
|
270 |
+
# )
|
271 |
|
272 |
# Load the selected emotion classifier
|
273 |
emotion_classifier = load_emotion_classifier(selected_model_key)
|
|
|
303 |
# Language Detection
|
304 |
if auto_detect:
|
305 |
detected_language = detect_language(user_input)
|
306 |
+
#else:
|
307 |
+
# detected_language = manual_language
|
308 |
|
309 |
# Display language detection results
|
310 |
display_language_info(detected_language)
|
|
|
358 |
dominant_emotion = max(emotion_predictions, key=lambda x: x['score'])
|
359 |
language_name = get_language_name(detected_language)
|
360 |
|
361 |
+
#st.markdown(f"**Responding with:** {dominant_emotion['label'].title()} emotion in {language_name}")
|
362 |
+
#st.markdown("---")
|
363 |
|
364 |
# Display the response in a nice container
|
365 |
with st.container():
|