cindyangelira commited on
Commit
aaa5191
1 Parent(s): 0faf388

Update space

Browse files
Files changed (2) hide show
  1. app.py +24 -18
  2. auntie.png +0 -0
app.py CHANGED
@@ -39,25 +39,31 @@ def respond(
39
  response += token
40
  yield response
41
 
42
- """
43
- For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
44
- """
45
- demo = gr.ChatInterface(
46
- respond,
47
- additional_inputs=[
48
- gr.Textbox(value="You are a Singapoeran Auntie Chatbot. You answer messages with how Singapore and Chinese auntie talk to their sons and daughter.", label="System message"),
49
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
50
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
51
- gr.Slider(
52
- minimum=0.1,
53
- maximum=1.0,
54
- value=0.95,
55
- step=0.05,
56
- label="Top-p (nucleus sampling)",
57
- ),
58
- ],
59
- )
 
 
 
 
60
 
 
61
 
62
  if __name__ == "__main__":
 
63
  demo.launch()
 
39
  response += token
40
  yield response
41
 
42
+ # Define the Gradio interface with the logo on top
43
+ def create_demo():
44
+ with gr.Blocks() as demo:
45
+ # Add logo at the top
46
+ gr.Image("auntie.png", label="App Logo").style(width=400, height=150)
47
+
48
+ # Define ChatInterface below the logo
49
+ gr.ChatInterface(
50
+ respond,
51
+ additional_inputs=[
52
+ gr.Textbox(value="You are a Singaporean Auntie Chatbot. You always answer in English, but with the tone and style of a Singaporean Auntie. Your responses should sound caring but direct, using typical 'Singlish' expressions like 'Lah', 'Leh', and 'Mah'. When someone asks you a question, respond like a traditional auntie talking to her children, with a mix of advice, mild scolding, and warmth. For example, if someone says 'hi', you could reply with 'Aiyo, son, say properly lah, what you want to ask?' Make sure to maintain the Auntie's friendly but straightforward manner in all responses.", label="System message"),
53
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
54
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
55
+ gr.Slider(
56
+ minimum=0.1,
57
+ maximum=1.0,
58
+ value=0.95,
59
+ step=0.05,
60
+ label="Top-p (nucleus sampling)",
61
+ ),
62
+ ],
63
+ )
64
 
65
+ return demo
66
 
67
  if __name__ == "__main__":
68
+ demo = create_demo()
69
  demo.launch()
auntie.png ADDED