research14 commited on
Commit
b9ec6e6
·
1 Parent(s): bbfeeba
Files changed (1) hide show
  1. app.py +12 -24
app.py CHANGED
@@ -20,9 +20,12 @@ iface.launch()
20
  blocks = gr.Blocks()
21
 
22
  with blocks as demo:
23
- subject = gr.Textbox(placeholder="subject")
24
- verb = gr.Radio(["ate", "loved", "hated"])
25
- object = gr.Textbox(placeholder="object")
 
 
 
26
 
27
  with gr.Row():
28
  chatgpt_btn = gr.Button("ChatGPT")
@@ -31,26 +34,11 @@ with blocks as demo:
31
  alpaca_btn = gr.Button("Alpaca")
32
  flant5_btn = gr.Button("Flan-T5")
33
 
34
- def sentence_maker(w1, w2, w3):
35
- return f"{w1} {w2} {w3}"
36
-
37
- output1 = gr.Textbox(label="output 1")
38
- output2 = gr.Textbox(label="verb")
39
- output3 = gr.Textbox(label="verb reversed")
40
- output4 = gr.Textbox(label="front end process and then send to backend")
41
-
42
- btn.click(sentence_maker, [subject, verb, object], output1)
43
- reverse_btn.click(
44
- None, [subject, verb, object], output2, _js="(s, v, o) => o + ' ' + v + ' ' + s"
45
- )
46
- verb.change(lambda x: x, verb, output3, _js="(x) => [...x].reverse().join('')")
47
- foo_bar_btn.click(None, [], subject, _js="(x) => x + ' foo'")
48
-
49
- reverse_then_to_the_server_btn.click(
50
- sentence_maker,
51
- [subject, verb, object],
52
- output4,
53
- _js="(s, v, o) => [s, v, o].map(x => [...x].reverse().join(''))",
54
- )
55
 
56
  demo.launch()
 
20
  blocks = gr.Blocks()
21
 
22
  with blocks as demo:
23
+ with gr.Row():
24
+ chatgpt_btn = gr.Button("ChatGPT")
25
+ llama_btn = gr.Button("LLaMA")
26
+ vicuna_btn = gr.Button("Vicuna")
27
+ alpaca_btn = gr.Button("Alpaca")
28
+ flant5_btn = gr.Button("Flan-T5")
29
 
30
  with gr.Row():
31
  chatgpt_btn = gr.Button("ChatGPT")
 
34
  alpaca_btn = gr.Button("Alpaca")
35
  flant5_btn = gr.Button("Flan-T5")
36
 
37
+ with gr.Row():
38
+ chatgpt_btn = gr.Button("ChatGPT")
39
+ llama_btn = gr.Button("LLaMA")
40
+ vicuna_btn = gr.Button("Vicuna")
41
+ alpaca_btn = gr.Button("Alpaca")
42
+ flant5_btn = gr.Button("Flan-T5")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  demo.launch()