Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
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 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
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
|