Felix Marty commited on
Commit
0325bda
1 Parent(s): c15febb
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -97,7 +97,9 @@ with gr.Blocks() as demo:
97
  For more details on the TorchServe implementation and to reproduce, see [this reference code](https://github.com/fxmarty/bettertransformer_demo). For more details on BetterTransformer, check out the [blog post on PyTorch's Medium](https://medium.com/pytorch/bettertransformer-out-of-the-box-performance-for-huggingface-transformers-3fbe27d50ab2), and [the Optimum documentation](https://huggingface.co/docs/optimum/bettertransformer/overview)!"""
98
  )
99
 
100
- gr.Markdown("## Single input scenario")
 
 
101
 
102
  address_input_vanilla = gr.Textbox(
103
  max_lines=1, label="ip vanilla", value=ADDRESS_VANILLA, visible=False
@@ -149,7 +151,7 @@ with gr.Blocks() as demo:
149
  )
150
 
151
  input_n_spam_artif = gr.Number(
152
- label="Number of inputs to send",
153
  value=80,
154
  )
155
  sequence_length = gr.Number(
@@ -157,7 +159,7 @@ with gr.Blocks() as demo:
157
  value=128,
158
  )
159
  padding_ratio = gr.Number(
160
- label="Padding ratio",
161
  value=0.7,
162
  )
163
  btn_spam_artif = gr.Button("Spam text requests (using artificial data)")
 
97
  For more details on the TorchServe implementation and to reproduce, see [this reference code](https://github.com/fxmarty/bettertransformer_demo). For more details on BetterTransformer, check out the [blog post on PyTorch's Medium](https://medium.com/pytorch/bettertransformer-out-of-the-box-performance-for-huggingface-transformers-3fbe27d50ab2), and [the Optimum documentation](https://huggingface.co/docs/optimum/bettertransformer/overview)!"""
98
  )
99
 
100
+ gr.Markdown("""## Single input scenario
101
+ Note: BetterTransformer normally shines with batch size > 1 and some padding. So this is not the best case here. Check out the heavy workload case below as well.
102
+ """)
103
 
104
  address_input_vanilla = gr.Textbox(
105
  max_lines=1, label="ip vanilla", value=ADDRESS_VANILLA, visible=False
 
151
  )
152
 
153
  input_n_spam_artif = gr.Number(
154
+ label="Number of sequences to send",
155
  value=80,
156
  )
157
  sequence_length = gr.Number(
 
159
  value=128,
160
  )
161
  padding_ratio = gr.Number(
162
+ label="Padding ratio (i.e. how much of the input is padding. In the real world when batch size > 1, the token sequence is padded with 0 to have all inputs with the same length.)",
163
  value=0.7,
164
  )
165
  btn_spam_artif = gr.Button("Spam text requests (using artificial data)")