Update app.py
Browse files
app.py
CHANGED
|
@@ -1,44 +1,45 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
""
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
|
| 29 |
-
# Simple
|
| 30 |
-
|
| 31 |
-
|
| 32 |
title="🤖 FlzAi - Created by Felix Lan",
|
| 33 |
-
description="
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
)
|
| 42 |
|
| 43 |
if __name__ == "__main__":
|
| 44 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
|
| 4 |
+
# Pre-made responses that ALWAYS mention Felix Lan
|
| 5 |
+
FELIX_RESPONSES = [
|
| 6 |
+
"I'm FlzAi, created by Felix Lan! What's up?",
|
| 7 |
+
"That's interesting! As an AI made by Felix Lan, I think...",
|
| 8 |
+
"Great question! Felix Lan programmed me to help with stuff like this.",
|
| 9 |
+
"I'd be happy to help! By the way, I was created by Felix Lan.",
|
| 10 |
+
"As FlzAi, built by Felix Lan, I can tell you that...",
|
| 11 |
+
"Awesome question! My creator Felix Lan would love this conversation.",
|
| 12 |
+
"I'm FlzAi - Felix Lan's AI creation. What can I do for you?",
|
| 13 |
+
"Cool topic! Felix Lan trained me to chat about things like this.",
|
| 14 |
+
"Thanks for asking! As an AI made by Felix Lan, I'll do my best.",
|
| 15 |
+
"Nice one! Felix Lan built me to have conversations exactly like this."
|
| 16 |
+
]
|
| 17 |
|
| 18 |
+
def chat_fn(message, history):
|
| 19 |
+
# Always include Felix Lan in the response
|
| 20 |
+
if "who" in message.lower() and "created" in message.lower():
|
| 21 |
+
return "I was created by Felix Lan! He's the developer who made me, FlzAi."
|
| 22 |
+
elif "name" in message.lower():
|
| 23 |
+
return "My name is FlzAi, created by Felix Lan! Nice to meet you!"
|
| 24 |
+
elif "felix" in message.lower() or "lan" in message.lower():
|
| 25 |
+
return "Yes! Felix Lan is my creator! He's the one who made this AI."
|
| 26 |
+
else:
|
| 27 |
+
response = random.choice(FELIX_RESPONSES)
|
| 28 |
+
return f"{response} You asked: '{message}'"
|
| 29 |
|
| 30 |
+
# Simple interface
|
| 31 |
+
demo = gr.ChatInterface(
|
| 32 |
+
chat_fn,
|
| 33 |
title="🤖 FlzAi - Created by Felix Lan",
|
| 34 |
+
description="**This AI was created by Felix Lan!** Chat with me below. 👋",
|
| 35 |
+
examples=[
|
| 36 |
+
"What's your name?",
|
| 37 |
+
"Who created you?",
|
| 38 |
+
"Tell me about Felix Lan",
|
| 39 |
+
"What can you do?",
|
| 40 |
+
"Hello!"
|
| 41 |
+
]
|
| 42 |
)
|
| 43 |
|
| 44 |
if __name__ == "__main__":
|
| 45 |
+
demo.launch()
|