tranquilkd commited on
Commit
da298a9
·
verified ·
1 Parent(s): 80e7bb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -63,6 +63,8 @@ model = load_model(R"GPT-Shakespeare.pth")
63
  # Define the Gradio interface
64
  demo = gr.Interface(
65
  fn=generate_text,
 
 
66
  inputs= [
67
  gr.Textbox(
68
  label="Input Text",
@@ -83,18 +85,15 @@ demo = gr.Interface(
83
  outputs=gr.Textbox(lines=5,
84
  placeholder="Generated text will be shown here",
85
  label="Generated Text"),
86
- title= """<h1 style='text-align: center;'> Text Generation using GPT \
87
- <a href='https://github.com/KD1994/session-12-Transformer-from-scratch-pt2' target='_blank'> \
88
  <i class='fab fa-github' style='font-size: 24px;'></i></a> \
89
- </h1> \
90
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">""",
91
- description = "<p style='text-align: center'> Decoder only transformer trained on \"Coriolanus\" by William Shakespeare </p>",
92
- # examples = [
93
- # ["My noble Coriolanus, temper thy rage. These men hold"],
94
- # ["Wisdom, say’st thou? Counsel, and truth? Nay, Menenius, they are"],
95
- # ["What speaks this man of war and violence?"],
96
- # ["Enough, Coriolanus! Thy words grow wild. What wouldst thou have?"]
97
- # ]
98
  )
99
 
100
  # Add error handling to launch
 
63
  # Define the Gradio interface
64
  demo = gr.Interface(
65
  fn=generate_text,
66
+ title="Text Generation using GPT",
67
+ description = "<p style='text-align: center'> Decoder only transformer trained on \"Coriolanus\" by William Shakespeare </p>",
68
  inputs= [
69
  gr.Textbox(
70
  label="Input Text",
 
85
  outputs=gr.Textbox(lines=5,
86
  placeholder="Generated text will be shown here",
87
  label="Generated Text"),
88
+ article= """<a href='https://github.com/KD1994/session-12-Transformer-from-scratch-pt2' target='_blank'> \
 
89
  <i class='fab fa-github' style='font-size: 24px;'></i></a> \
90
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">""",
91
+ examples = [
92
+ ["My noble Coriolanus, temper thy rage. These men hold"],
93
+ ["Wisdom, say’st thou? Counsel, and truth? Nay, Menenius, they are"],
94
+ ["What speaks this man of war and violence?"],
95
+ ["Enough, Coriolanus! Thy words grow wild. What wouldst thou have?"]
96
+ ]
 
 
97
  )
98
 
99
  # Add error handling to launch