Update app.py
Browse files
app.py
CHANGED
@@ -167,7 +167,7 @@ def generate_with_all_models(commentary_text, num_words, max_length, temperature
|
|
167 |
lstm_output = generate_with_lstm(commentary_text, num_words)
|
168 |
rnn_output = generate_with_rnn(commentary_text, num_words)
|
169 |
gpt2_finetuned_output, gpt2_base_output = generate_with_gpt2(commentary_text, max_length, temperature)
|
170 |
-
return rnn_output, lstm_output,
|
171 |
|
172 |
# Create the Gradio interface
|
173 |
iface = gr.Interface(
|
@@ -181,11 +181,11 @@ iface = gr.Interface(
|
|
181 |
outputs=[
|
182 |
gr.Textbox(label="RNN Model Output"),
|
183 |
gr.Textbox(label="LSTM Model Output"),
|
184 |
-
gr.Textbox(label="GPT-2
|
185 |
-
gr.Textbox(label="GPT-2
|
186 |
],
|
187 |
title="Next word prediction with RNN, LSTM and GPT-2 Models",
|
188 |
-
description="Start writing a cricket commentary and various models will try to continue it. Compare outputs from LSTM, RNN, and GPT-2 (
|
189 |
)
|
190 |
|
191 |
# Launch the app
|
|
|
167 |
lstm_output = generate_with_lstm(commentary_text, num_words)
|
168 |
rnn_output = generate_with_rnn(commentary_text, num_words)
|
169 |
gpt2_finetuned_output, gpt2_base_output = generate_with_gpt2(commentary_text, max_length, temperature)
|
170 |
+
return rnn_output, lstm_output, gpt2_base_output, gpt2_finetuned_output
|
171 |
|
172 |
# Create the Gradio interface
|
173 |
iface = gr.Interface(
|
|
|
181 |
outputs=[
|
182 |
gr.Textbox(label="RNN Model Output"),
|
183 |
gr.Textbox(label="LSTM Model Output"),
|
184 |
+
gr.Textbox(label="GPT-2 Base Model Output (not-finetuned)"),
|
185 |
+
gr.Textbox(label="GPT-2 Finetuned Model Output")
|
186 |
],
|
187 |
title="Next word prediction with RNN, LSTM and GPT-2 Models",
|
188 |
+
description="Start writing a cricket commentary and various models will try to continue it. Compare outputs from LSTM, RNN, and GPT-2 (base & finetuned) models."
|
189 |
)
|
190 |
|
191 |
# Launch the app
|