Ye Ting commited on
Commit
30eba1c
·
1 Parent(s): 23a3f8b
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -14,6 +14,9 @@ def calc_extra_token_length(old_seq_len: int = 4096, old_base: int = 10000, new_
14
  extra = 2 * np.pi * new_base ** b
15
  return extra / 1024
16
 
 
 
 
17
  #%%
18
  with gr.Blocks() as demo:
19
  gr.Markdown("# some tools")
@@ -24,6 +27,12 @@ with gr.Blocks() as demo:
24
  outputs = gr.Text(label="output text")
25
  btn.click(fn=greet, inputs=inputs, outputs=outputs)
26
 
 
 
 
 
 
 
27
  with gr.Tab("calc_extra_token_length"):
28
  with gr.Row():
29
  with gr.Column():
 
14
  extra = 2 * np.pi * new_base ** b
15
  return extra / 1024
16
 
17
+ def hello_world(name):
18
+ return "你好 " + name + "!!"
19
+
20
  #%%
21
  with gr.Blocks() as demo:
22
  gr.Markdown("# some tools")
 
27
  outputs = gr.Text(label="output text")
28
  btn.click(fn=greet, inputs=inputs, outputs=outputs)
29
 
30
+ with gr.Tab("hello world"):
31
+ inputs = gr.Text(label="input text")
32
+ btn = gr.Button()
33
+ outputs = gr.Text(label="output text")
34
+ btn.click(fn=hello_world, inputs=inputs, outputs=outputs)
35
+
36
  with gr.Tab("calc_extra_token_length"):
37
  with gr.Row():
38
  with gr.Column():