silentkiller1904 commited on
Commit
906c141
·
verified ·
1 Parent(s): 66555f9

Update app.py

Browse files

Added condition

Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -68,6 +68,10 @@ def chatbot(user_input,history_state,temprature_slider, session_id=str(uuid.uui
68
  Function to handle user input and generate a response.
69
  It maintains the session history and returns the response.
70
  """
 
 
 
 
71
  llm.temperature = temprature_slider # Set the temperature for the model
72
 
73
  response = chain.invoke(
 
68
  Function to handle user input and generate a response.
69
  It maintains the session history and returns the response.
70
  """
71
+
72
+ if(user_input.strip() == ""):
73
+ return "Please enter a valid question."
74
+
75
  llm.temperature = temprature_slider # Set the temperature for the model
76
 
77
  response = chain.invoke(