Amitontheweb commited on
Commit
ef23faf
1 Parent(s): 2ee9bcb
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -289,11 +289,7 @@ def clear():
289
  with gr.Blocks() as demo:
290
 
291
  No_beam_group_list = [2]
292
- text = gr.Textbox(
293
- label="Prompt",
294
- value="It's a rainy day today",
295
- )
296
-
297
  tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
298
  model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2", pad_token_id=tokenizer.eos_token_id)
299
 
@@ -360,7 +356,15 @@ with gr.Blocks() as demo:
360
  repetition_penalty = gr.Slider(
361
  label="Repetition penalty", minimum=0, maximum=3, step=1, value=float(0), info="Prior context based penalty for unique text"
362
  )
 
 
363
 
 
 
 
 
 
 
364
 
365
 
366
  #----------ON SELECTING/CHANGING: RETURN SEEQUENCES/NO OF BEAMS/BEAM GROUPS/TEMPERATURE--------
@@ -388,9 +392,7 @@ with gr.Blocks() as demo:
388
 
389
  #-------------GENERATE BUTTON-------------------
390
 
391
- button = gr.Button("Generate")
392
- out_markdown = gr.Textbox()
393
-
394
 
395
  button.click(
396
  fn = generate,
@@ -404,4 +406,3 @@ with gr.Blocks() as demo:
404
 
405
 
406
  demo.launch()
407
-
 
289
  with gr.Blocks() as demo:
290
 
291
  No_beam_group_list = [2]
292
+
 
 
 
 
293
  tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
294
  model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2", pad_token_id=tokenizer.eos_token_id)
295
 
 
356
  repetition_penalty = gr.Slider(
357
  label="Repetition penalty", minimum=0, maximum=3, step=1, value=float(0), info="Prior context based penalty for unique text"
358
  )
359
+
360
+ with gr.Column(scale=0, min_width=200):
361
 
362
+ text = gr.Textbox(
363
+ label="Prompt",
364
+ value="It's a rainy day today",
365
+ )
366
+
367
+ out_markdown = gr.Textbox()
368
 
369
 
370
  #----------ON SELECTING/CHANGING: RETURN SEEQUENCES/NO OF BEAMS/BEAM GROUPS/TEMPERATURE--------
 
392
 
393
  #-------------GENERATE BUTTON-------------------
394
 
395
+ button = gr.Button("Generate", min_width=100)
 
 
396
 
397
  button.click(
398
  fn = generate,
 
406
 
407
 
408
  demo.launch()