likewendy commited on
Commit
94f09c8
·
1 Parent(s): aca8f85
Files changed (1) hide show
  1. app.py +24 -28
app.py CHANGED
@@ -61,34 +61,30 @@ def respond(
61
  yield response
62
 
63
  with gr.Blocks() as demo:
64
- gr.LoginButton(min_width=250)
65
- """
66
- For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
67
- """
68
- gr.Markdown("""
69
- This is the space I built.
70
- As of 2025/1/7, this is the first phi-4 space.
71
- If this helps you, and if you have enough money, can you give me 1$? I am facing a financial crisis.
72
- If you do this, I will pass on the kindness.
73
- This is my bank card number:5592921230414708
74
- Thank you!!
75
- """)
76
- gr.ChatInterface(
77
- respond,
78
- additional_inputs=[
79
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
80
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
81
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
82
- gr.Slider(
83
- minimum=0.1,
84
- maximum=1.0,
85
- value=0.95,
86
- step=0.05,
87
- label="Top-p (nucleus sampling)",
88
- ),
89
- gr.Slider(minimum=0, maximum=20091114, value=42, step=1, label="seed"),
90
- ],
91
- )
92
 
93
 
94
  if __name__ == "__main__":
 
61
  yield response
62
 
63
  with gr.Blocks() as demo:
64
+ with gr.Row():
65
+ gr.LoginButton(min_width=100)
66
+ gr.Markdown("""
67
+ This is the space I built.
68
+ As of 2025/1/7, this is the first phi-4 space.
69
+ If this helps you, and if you have enough money, can you give me 1$? I am facing a financial crisis.
70
+ If you do this, I will pass on the kindness.
71
+ This is my bank card number:5592921230414708
72
+ Thank you!!
73
+ """)
74
+
75
+ with gr.Row():
76
+ with gr.Column():
77
+ system_message = gr.Textbox(value="You are a friendly Chatbot.", label="System message")
78
+ max_tokens = gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens")
79
+ temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
80
+ top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)")
81
+ seed = gr.Slider(minimum=0, maximum=20091114, value=42, step=1, label="Seed")
82
+
83
+ with gr.Column():
84
+ gr.ChatInterface(
85
+ respond,
86
+ additional_inputs=[system_message, max_tokens, temperature, top_p, seed],
87
+ )
 
 
 
 
88
 
89
 
90
  if __name__ == "__main__":