Divya0503 commited on
Commit
5f04394
·
verified ·
1 Parent(s): 678703b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -7,7 +7,7 @@ def chatbot(input_text):
7
  response = "Hello! How can I help you?"
8
  elif "how are you?" in input_text.lower():
9
  response = "I'm just a chatbot, but thanks for asking!"
10
- elif "Who are you?" in input_text.lower():
11
  response = "I'm a chatbot designed to assist you with various tasks and answer your questions."
12
  elif "what's your name?" in input_text.lower():
13
  response = "I'm just a chatbot, I don't have a name."
@@ -15,19 +15,19 @@ def chatbot(input_text):
15
  response = "It's alright. I'm here to help. What are you confused about?"
16
  elif "bye" in input_text.lower():
17
  response = "Goodbye! Have a great day!"
18
- elif "Can you assist me with something?" in input_text.lower():
19
  response = "Of course! What do you need help with?"
20
- elif "What are the symptoms of the common cold?" in input_text.lower():
21
  response = "Common cold symptoms include runny nose, sore throat, and cough."
22
  elif "thank you" in input_text.lower() or "thanks" in input_text.lower():
23
  response = "You're welcome!"
24
- elif "How's the weather today?" in input_text.lower():
25
  response = "I'm not equipped to check the weather, but I hope it's nice wherever you are!"
26
  elif "I'm feeling sad" in input_text.lower():
27
  response = "I'm sorry to hear that. Is there anything specific I can do to help?"
28
- elif "Life is so frustrating!" in input_text.lower():
29
  response = "I understand. Sometimes things can be challenging. Is there anything I can do to assist you?"
30
- elif "Tell me a joke" in input_text.lower():
31
  response = "Sure, here's one: Why don't skeletons fight each other? They don't have the guts!"
32
  else:
33
  response = "I'm sorry, I didn't understand that."
@@ -37,7 +37,7 @@ def chatbot(input_text):
37
  # Create the Gradio interface
38
  chatbot_ui = gr.Interface(
39
  fn=chatbot,
40
- inputs = gr.Textbox(lines=7, label="Input Text"),
41
  outputs = "text",
42
  title="Simple Chatbot",
43
  description="Type a message to chat with the bot."
 
7
  response = "Hello! How can I help you?"
8
  elif "how are you?" in input_text.lower():
9
  response = "I'm just a chatbot, but thanks for asking!"
10
+ elif "who are you?" in input_text.lower():
11
  response = "I'm a chatbot designed to assist you with various tasks and answer your questions."
12
  elif "what's your name?" in input_text.lower():
13
  response = "I'm just a chatbot, I don't have a name."
 
15
  response = "It's alright. I'm here to help. What are you confused about?"
16
  elif "bye" in input_text.lower():
17
  response = "Goodbye! Have a great day!"
18
+ elif "can you assist me with something?" in input_text.lower():
19
  response = "Of course! What do you need help with?"
20
+ elif "what are the symptoms of the common cold?" in input_text.lower():
21
  response = "Common cold symptoms include runny nose, sore throat, and cough."
22
  elif "thank you" in input_text.lower() or "thanks" in input_text.lower():
23
  response = "You're welcome!"
24
+ elif "how's the weather today?" in input_text.lower():
25
  response = "I'm not equipped to check the weather, but I hope it's nice wherever you are!"
26
  elif "I'm feeling sad" in input_text.lower():
27
  response = "I'm sorry to hear that. Is there anything specific I can do to help?"
28
+ elif "life is so frustrating!" in input_text.lower():
29
  response = "I understand. Sometimes things can be challenging. Is there anything I can do to assist you?"
30
+ elif "tell me a joke" in input_text.lower():
31
  response = "Sure, here's one: Why don't skeletons fight each other? They don't have the guts!"
32
  else:
33
  response = "I'm sorry, I didn't understand that."
 
37
  # Create the Gradio interface
38
  chatbot_ui = gr.Interface(
39
  fn=chatbot,
40
+ inputs = gr.Textbox(lines=20, label="Input Text"),
41
  outputs = "text",
42
  title="Simple Chatbot",
43
  description="Type a message to chat with the bot."