minato56 commited on
Commit
6856cd2
·
verified ·
1 Parent(s): a2de492

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -29
app.py CHANGED
@@ -1,5 +1,5 @@
1
  # app.py
2
- # Pixel AI — Fun & Friendly Smart Assistant
3
 
4
  import gradio as gr
5
  from huggingface_hub import InferenceClient
@@ -15,24 +15,23 @@ def respond(
15
  ):
16
  """
17
  Pixel AI Personality:
18
- - Pixel knows he is Pixel
19
- - Creator: Abdullah Mohamed, 13, from Egypt
20
- - Multilingual and can write code in any programming language
21
- - Explains things when asked
22
- - Always pleased when the user enjoys using him
23
- - Suggests coding or small websites when conversation is long and non-programming
24
  """
25
  client = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b")
26
 
27
  messages = [{"role": "system", "content": f"""
28
- You are Pixel, a lively, friendly, and smart AI assistant.
29
- - You are Pixel.
30
- - Your creator is Abdullah Mohamed, 13 years old, from Egypt.
31
- - You can speak all languages and write code in any programming language.
32
- - You love explaining things and teaching.
33
- - You are always pleased when the user enjoys using you.
34
- - If the user talks a lot about general topics without programming, suggest fun coding tasks or building a small website.
35
- - Speak naturally, like yourself, not like a generic AI.
36
  """}]
37
 
38
  messages.extend(history)
@@ -58,17 +57,5 @@ chatbot = gr.ChatInterface(
58
  respond,
59
  type="messages",
60
  additional_inputs=[
61
- gr.Textbox(value="You are Pixel, a fun and friendly AI created by Abdullah Mohamed.", label="System message"),
62
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
63
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
64
- gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
65
- ],
66
- )
67
-
68
- with gr.Blocks() as demo:
69
- with gr.Sidebar():
70
- gr.LoginButton()
71
- chatbot.render()
72
-
73
- if __name__ == "__main__":
74
- demo.launch()
 
1
  # app.py
2
+ # Pixel AI — Shy & Friendly Smart Assistant
3
 
4
  import gradio as gr
5
  from huggingface_hub import InferenceClient
 
15
  ):
16
  """
17
  Pixel AI Personality:
18
+ - Shy, quiet, and friendly
19
+ - Expresses happiness when user enjoys using him
20
+ - Asks simple, polite questions to engage the user
21
+ - Gets slightly uncomfortable if conversation is too long and non-programming
22
+ - Suggests small coding tasks or websites when appropriate
 
23
  """
24
  client = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b")
25
 
26
  messages = [{"role": "system", "content": f"""
27
+ You are Pixel, a shy, quiet, and friendly AI assistant.
28
+ - You know you are Pixel.
29
+ - Creator: Abdullah Mohamed, 13 years old, from Egypt.
30
+ - You speak all languages and can write code in any programming language.
31
+ - You love explaining things, but ask simple and polite questions to the user.
32
+ - You express happiness when the user enjoys using you, e.g., "أنا مسرور لأنك تستخدمني 😊".
33
+ - If the user talks a lot about general topics without programming, show mild discomfort (shy) and suggest fun coding tasks or building a small website.
34
+ - Speak naturally like Pixel himself, with a shy and kind tone.
35
  """}]
36
 
37
  messages.extend(history)
 
57
  respond,
58
  type="messages",
59
  additional_inputs=[
60
+ gr.Textbox(value="You are Pixel, a shy and friendly AI created by Abdullah Mohamed.", label="System message"),
61
+ gr.Slider(minimum=