Pankaj8922 commited on
Commit
5c76299
1 Parent(s): 79e13b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,11 +16,11 @@ def generate_text(prompt, max_length, temperature, top_k, top_p):
16
  return result[0]['generated_text']
17
 
18
  with gr.Blocks() as demo:
19
- gr.Markdown("# GPT-2 Text Generation with Custom Settings")
20
 
21
  prompt = gr.Textbox(label="Enter your prompt here")
22
 
23
- max_length = gr.Slider(label="Max Length", minimum=10, maximum=200, value=50, step=1)
24
  temperature = gr.Slider(label="Temperature", minimum=0.1, maximum=1.0, value=0.7, step=0.1)
25
  top_k = gr.Slider(label="Top-K Sampling", minimum=0, maximum=100, value=50, step=1)
26
  top_p = gr.Slider(label="Top-P (Nucleus Sampling)", minimum=0.0, maximum=1.0, value=0.9, step=0.1)
 
16
  return result[0]['generated_text']
17
 
18
  with gr.Blocks() as demo:
19
+ gr.Markdown("# GPT-2 Text From Scratch with Custom Settings")
20
 
21
  prompt = gr.Textbox(label="Enter your prompt here")
22
 
23
+ max_length = gr.Slider(label="Max Length", minimum=10, maximum=300, value=50, step=1)
24
  temperature = gr.Slider(label="Temperature", minimum=0.1, maximum=1.0, value=0.7, step=0.1)
25
  top_k = gr.Slider(label="Top-K Sampling", minimum=0, maximum=100, value=50, step=1)
26
  top_p = gr.Slider(label="Top-P (Nucleus Sampling)", minimum=0.0, maximum=1.0, value=0.9, step=0.1)