iofu728 commited on
Commit
0ca26f4
1 Parent(s): bd02cc7

Feature(LLMLingua): add examples

Browse files
Files changed (1) hide show
  1. app.py +18 -5
app.py CHANGED
@@ -109,11 +109,15 @@ with gr.Blocks(css=custom_css) as iface:
109
  label="Compression Ratio (To use this, set Target Token to -1)",
110
  value=0,
111
  )
 
 
 
 
112
 
113
  gen_button = gr.Button(value="Compress Prompt!", variant="primary")
114
 
115
  with gr.Row():
116
- with gr.Column(elem_id="Results", scale=2):
117
  with gr.Tab('Compressed Prompts'):
118
  compressed_prompt = gr.Textbox(
119
  label="compressed_prompt",
@@ -133,12 +137,21 @@ with gr.Blocks(css=custom_css) as iface:
133
  saving = gr.Textbox(
134
  label="Saving Cost",
135
  )
 
 
 
136
 
137
 
138
- gr.Examples(
139
- examples=EXAMPLES,
140
- # inputs=[image_upload, positive_prompt, negative_prompt],
141
- )
 
 
 
 
 
 
142
 
143
  gen_button.click(
144
  fn=compress_prompt,
 
109
  label="Compression Ratio (To use this, set Target Token to -1)",
110
  value=0,
111
  )
112
+ # model_name = gr.Textbox(
113
+ # label="Small Language Model (only support lgaalves/gpt2-dolly now)",
114
+ # value="lgaalves/gpt2-dolly",
115
+ # )
116
 
117
  gen_button = gr.Button(value="Compress Prompt!", variant="primary")
118
 
119
  with gr.Row():
120
+ with gr.Column(elem_id="Results", scale=1):
121
  with gr.Tab('Compressed Prompts'):
122
  compressed_prompt = gr.Textbox(
123
  label="compressed_prompt",
 
137
  saving = gr.Textbox(
138
  label="Saving Cost",
139
  )
140
+ # acc = gr.Textbox(
141
+ # label="GSM8K Acc using GPT-3.5-Turbo",
142
+ # )
143
 
144
 
145
+ # gr.Examples(
146
+ # examples=EXAMPLES,
147
+ # inputs=[model_name, compressed_prompt, saving_ratio, acc],
148
+ # )
149
+
150
+ gr.Dataframe(
151
+ value=EXAMPLES,
152
+ headers=["Small Language Model", "Compressed Prompts", "Actual Compression Ratio", "GSM8K Acc using GPT-3.5-Turbo"],
153
+ datatype=["str", "str", "str", "str", "str"],
154
+ ),
155
 
156
  gen_button.click(
157
  fn=compress_prompt,