Update app.py
Browse files
app.py
CHANGED
@@ -28,8 +28,8 @@ def get_image_input(title, given_input_style):
|
|
28 |
|
29 |
# Available models for generate lyrics pipeline
|
30 |
# checkpoint = 'wvangils/GPT-Medium-Beatles-Lyrics-finetuned-newlyrics'
|
31 |
-
|
32 |
-
checkpoint = 'wvangils/BLOOM-560m-Beatles-Lyrics-finetuned'
|
33 |
|
34 |
# Setup all the pipelines we need
|
35 |
title_generator = pipeline('summarization', model='czearing/story-to-title')
|
@@ -72,7 +72,7 @@ def generate_beatles(input_prompt, temperature, top_p, given_input_style):
|
|
72 |
return (title, generated_lyrics, image, image_style)
|
73 |
|
74 |
# Create textboxes for input and output
|
75 |
-
input_box = gr.Textbox(label="Write the start of a song here", placeholder="Write the start of a new song here", value="
|
76 |
gen_lyrics = gr.Textbox(label="Song lyrics", lines=15)
|
77 |
gen_title = gr.Textbox(label="Proposed songtitle", lines=1)
|
78 |
gen_image = gr.Gallery(label="Proposed song cover").style(grid=1, height="auto")
|
@@ -83,7 +83,7 @@ title='Beatles lyrics generator'
|
|
83 |
description="<p style='text-align: center'>We've fine-tuned multiple language models on lyrics from The Beatles to generate Beatles-like text. Below are the results we obtained fine-tuning a GPT Neo model. After generation a title is generated using <a href='https://huggingface.co/czearing/story-to-title' target='_blank'>this model</a>. On top we use the generated title to suggest an album cover using <a href='https://huggingface.co/CompVis/stable-diffusion-v1-4' target='_blank'>Stable Diffusion 1.4</a>. Give it a try!</p>"
|
84 |
article="""<p style='text-align: left'>These text generation models that output Beatles-like text were created by data scientists working for <a href='https://cmotions.nl/' target="_blank">Cmotions.</a>
|
85 |
We tried several text generation models that we were able to load in Colab: a general <a href='https://huggingface.co/gpt2-medium' target='_blank'>GPT2-medium</a> model, the Eleuther AI small-sized GPT model <a href='https://huggingface.co/EleutherAI/gpt-neo-125M' target='_blank'>GPT-Neo</a> and the new kid on the block build by the <a href='https://bigscience.notion.site/BLOOM-BigScience-176B-Model-ad073ca07cdf479398d5f95d88e218c4' target='_blank'>Bigscience</a> initiative <a href='https://huggingface.co/bigscience/bloom-560m' target='_blank'>BLOOM 560m</a>.
|
86 |
-
Further we've put together a <a href='https://huggingface.co/datasets/cmotions/Beatles_lyrics' target='_blank'> Huggingface dataset</a> containing all known lyrics created by The Beatles.
|
87 |
The default output contains 100 tokens and has a repetition penalty of 1.0.
|
88 |
</p>"""
|
89 |
css = """
|
|
|
28 |
|
29 |
# Available models for generate lyrics pipeline
|
30 |
# checkpoint = 'wvangils/GPT-Medium-Beatles-Lyrics-finetuned-newlyrics'
|
31 |
+
checkpoint = 'wvangils/GPT-Neo-125m-Beatles-Lyrics-finetuned-newlyrics'
|
32 |
+
# checkpoint = 'wvangils/BLOOM-560m-Beatles-Lyrics-finetuned'
|
33 |
|
34 |
# Setup all the pipelines we need
|
35 |
title_generator = pipeline('summarization', model='czearing/story-to-title')
|
|
|
72 |
return (title, generated_lyrics, image, image_style)
|
73 |
|
74 |
# Create textboxes for input and output
|
75 |
+
input_box = gr.Textbox(label="Write the start of a song here", placeholder="Write the start of a new song here", value="It's been three days ", lines=2, max_lines=5)
|
76 |
gen_lyrics = gr.Textbox(label="Song lyrics", lines=15)
|
77 |
gen_title = gr.Textbox(label="Proposed songtitle", lines=1)
|
78 |
gen_image = gr.Gallery(label="Proposed song cover").style(grid=1, height="auto")
|
|
|
83 |
description="<p style='text-align: center'>We've fine-tuned multiple language models on lyrics from The Beatles to generate Beatles-like text. Below are the results we obtained fine-tuning a GPT Neo model. After generation a title is generated using <a href='https://huggingface.co/czearing/story-to-title' target='_blank'>this model</a>. On top we use the generated title to suggest an album cover using <a href='https://huggingface.co/CompVis/stable-diffusion-v1-4' target='_blank'>Stable Diffusion 1.4</a>. Give it a try!</p>"
|
84 |
article="""<p style='text-align: left'>These text generation models that output Beatles-like text were created by data scientists working for <a href='https://cmotions.nl/' target="_blank">Cmotions.</a>
|
85 |
We tried several text generation models that we were able to load in Colab: a general <a href='https://huggingface.co/gpt2-medium' target='_blank'>GPT2-medium</a> model, the Eleuther AI small-sized GPT model <a href='https://huggingface.co/EleutherAI/gpt-neo-125M' target='_blank'>GPT-Neo</a> and the new kid on the block build by the <a href='https://bigscience.notion.site/BLOOM-BigScience-176B-Model-ad073ca07cdf479398d5f95d88e218c4' target='_blank'>Bigscience</a> initiative <a href='https://huggingface.co/bigscience/bloom-560m' target='_blank'>BLOOM 560m</a>.
|
86 |
+
Further we've put together a <a href='https://huggingface.co/datasets/cmotions/Beatles_lyrics' target='_blank'> Huggingface dataset</a> containing all known lyrics created by The Beatles. Keep an eye on this <a href='https://www.theanalyticslab.nl/blogs/' target='_blank'>location </a> where we will publish several blogs on the creation of these models and their evaluation.
|
87 |
The default output contains 100 tokens and has a repetition penalty of 1.0.
|
88 |
</p>"""
|
89 |
css = """
|