drmurataltun commited on
Commit
7913ee4
·
verified ·
1 Parent(s): ba56b3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -8,12 +8,15 @@ def trim_words(words, lens):
8
  trimmed_words.append(w[:int(l)])
9
  return [trimmed_words]
10
 
11
- demo = gr.Interface(
12
- fn=trim_words,
13
- inputs=["textbox", "number"],
14
- outputs=["output"],
15
- batch=True,
16
- max_batch_size=16
17
- )
 
 
 
18
 
19
  demo.launch()
 
8
  trimmed_words.append(w[:int(l)])
9
  return [trimmed_words]
10
 
11
+
12
+ with gr.Blocks() as demo:
13
+ with gr.Row():
14
+ word = gr.Textbox(label="word")
15
+ leng = gr.Number(label="leng")
16
+ output = gr.Textbox(label="Output")
17
+ with gr.Row():
18
+ run = gr.Button()
19
+
20
+ event = run.click(trim_words, [word, leng], output, batch=True, max_batch_size=16)
21
 
22
  demo.launch()