Spaces:
Sleeping
Sleeping
Update Update app.py
Browse files- Update app.py +4 -4
Update app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
import
|
2 |
|
3 |
def chatbot(input_text):
|
4 |
-
|
5 |
return "Hello, how can i help you."
|
6 |
elif input_text.lower() == "how are you":
|
7 |
return "I'm doing well, thank you for asking."
|
@@ -13,8 +13,8 @@ def chatbot(input_text):
|
|
13 |
return "Coding, also known as programming, is the process of creating instructions for computers to execute. It involves writing code in programming languages like Python, Java, or C++. These instructions can range from simple tasks, like printing a message, to complex algorithms that power applications and systems. Coding allows developers to build software, websites, games, and more, enabling computers to perform specific functions or solve problems. Essentially, coding is how humans communicate their ideas to machines.
|
14 |
elif input_text.lower() == "How many country in the world":
|
15 |
return "As of 2024, there are 195 countries in the world. This total includes 193 member states of the United Nations and 2 observer states: the Holy See (Vatican City) and Palestine"
|
16 |
-
else:
|
17 |
-
|
18 |
|
19 |
demo = gradio.Interface(fn=chatbot, inputs="text", outputs="text", title="Chatbot")
|
20 |
demo.launch()
|
|
|
1 |
+
import gradiodef chatbot(input_text):
|
2 |
|
3 |
def chatbot(input_text):
|
4 |
+
if input_text.lower() == "hello":
|
5 |
return "Hello, how can i help you."
|
6 |
elif input_text.lower() == "how are you":
|
7 |
return "I'm doing well, thank you for asking."
|
|
|
13 |
return "Coding, also known as programming, is the process of creating instructions for computers to execute. It involves writing code in programming languages like Python, Java, or C++. These instructions can range from simple tasks, like printing a message, to complex algorithms that power applications and systems. Coding allows developers to build software, websites, games, and more, enabling computers to perform specific functions or solve problems. Essentially, coding is how humans communicate their ideas to machines.
|
14 |
elif input_text.lower() == "How many country in the world":
|
15 |
return "As of 2024, there are 195 countries in the world. This total includes 193 member states of the United Nations and 2 observer states: the Holy See (Vatican City) and Palestine"
|
16 |
+
else:
|
17 |
+
return "I'm sorry, I don't understand. Could you please rephrase your question?."
|
18 |
|
19 |
demo = gradio.Interface(fn=chatbot, inputs="text", outputs="text", title="Chatbot")
|
20 |
demo.launch()
|