mojakob commited on
Commit
76dfd30
·
verified ·
1 Parent(s): 428b100

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -669,17 +669,6 @@ def new_chat_input(user_input, chat_history, user_state, attribution_slider=None
669
  gr.update(visible=False) # Confirm button
670
  )
671
  chat_history.append((user_input, ""))
672
-
673
- # if attribution_slider < 1 or attribution_slider > 10:
674
- # response = "Please pick a number between 1 and 10."
675
- # chat_history.append(("", response))
676
- # return (
677
- # chat_history, # Updated chat history
678
- # user_state, # Updated user state
679
- # gr.update(visible=False), # Hide the textbox
680
- # gr.update(visible=True), # Show the slider
681
- # gr.update(visible=True) # Show the Confirm button
682
- # )
683
 
684
  vignette_tones = [
685
  'Positive', 'Negative', 'Negative', 'Positive', 'Positive', 'Negative', 'Negative', 'Positive',
@@ -1256,7 +1245,18 @@ def new_chat_input(user_input, chat_history, user_state, attribution_slider=None
1256
  # gr.update(visible=True) # Confirm button
1257
  # )
1258
 
1259
- else:
 
 
 
 
 
 
 
 
 
 
 
1260
  # For internal/external
1261
  if user_state["stage"] == "internal_external":
1262
  user_state["standardized_data"]['Raw Internal_External'] = attribution_slider
 
669
  gr.update(visible=False) # Confirm button
670
  )
671
  chat_history.append((user_input, ""))
 
 
 
 
 
 
 
 
 
 
 
672
 
673
  vignette_tones = [
674
  'Positive', 'Negative', 'Negative', 'Positive', 'Positive', 'Negative', 'Negative', 'Positive',
 
1245
  # gr.update(visible=True) # Confirm button
1246
  # )
1247
 
1248
+ else:
1249
+ if attribution_slider < 1 or attribution_slider > 10:
1250
+ response = "Please pick a number between 1 and 10."
1251
+ chat_history.append(("", response))
1252
+ return (
1253
+ chat_history, # Updated chat history
1254
+ user_state, # Updated user state
1255
+ gr.update(visible=False), # Hide the textbox
1256
+ gr.update(visible=True), # Show the slider
1257
+ gr.update(visible=True) # Show the Confirm button
1258
+ )
1259
+
1260
  # For internal/external
1261
  if user_state["stage"] == "internal_external":
1262
  user_state["standardized_data"]['Raw Internal_External'] = attribution_slider