Spaces:
Sleeping
Sleeping
Update Update app.py
Browse files- Update app.py +5 -10
Update app.py
CHANGED
@@ -1,20 +1,15 @@
|
|
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."
|
8 |
elif input_text.lower() == "bye":
|
9 |
return "Goodbye! Have a great day."
|
10 |
-
|
11 |
-
return "Currently, the weather in Chandigarh is 31°C with a humidity level of 66%. The wind is blowing from the southeast at 5.6 km/h. Conditions are mostly dry, and this trend is expected to continue over the next few day."
|
12 |
-
elif input_text.lower() == "What is a coding":
|
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()
|
|
|
1 |
+
import gradio
|
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."
|
8 |
elif input_text.lower() == "bye":
|
9 |
return "Goodbye! Have a great day."
|
10 |
+
else:
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
return "I'm sorry, I don't understand. Could you please rephrase your question?."
|
12 |
|
13 |
+
|
14 |
demo = gradio.Interface(fn=chatbot, inputs="text", outputs="text", title="Chatbot")
|
15 |
+
demo.launch()
|