{"id":19174992,"url":"https://github.com/losttech/billionsongs","last_synced_at":"2025-05-07T18:21:37.018Z","repository":{"id":124319681,"uuid":"183669916","full_name":"losttech/BillionSongs","owner":"losttech","description":"Gradient + TensorFlow + GPT-2-powered \"AI\" song lyrics generator, built as an ASP.NET Core website.","archived":false,"fork":false,"pushed_at":"2023-04-07T20:56:49.000Z","size":1076,"stargazers_count":66,"open_issues_count":1,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-19T06:03:28.686Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/losttech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-26T17:34:34.000Z","updated_at":"2025-01-01T09:06:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"5fc0a294-e8d7-4416-a56e-8422abcc2ca8","html_url":"https://github.com/losttech/BillionSongs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losttech%2FBillionSongs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losttech%2FBillionSongs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losttech%2FBillionSongs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losttech%2FBillionSongs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/losttech","download_url":"https://codeload.github.com/losttech/BillionSongs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931819,"owners_count":21827172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T10:20:17.308Z","updated_at":"2025-05-07T18:21:36.989Z","avatar_url":"https://github.com/losttech.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Billion Songs, AI-powered song lyrics generator\n\n[Generate a song](https://billionsongs.azurewebsites.net/)\n\n\u003e NOTE: this repository has git submodules. So clone with --recurse-submodules.\n\u003e Learn about them [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules).\n\nSee the blog post\n[Writing billion songs with C# and Deep Learning](https://lostmsu.github.io/BillionSongs/)\nfor a detailed explanation how it works.\n\nThis project mainly serves as a demonstration of\n[Gradient](https://losttech.software/gradient.html),\nour TensorFlow binding for C# and other .NET languages.\n\n[Other Gradient samples](https://github.com/losttech/Gradient-Samples).\n\n# What is it, and how does it work?\n\nThis is a deep learning-powered song lyrics generator, based on\n[GPT-2](https://github.com/openai/gpt-2), wrapped as a ASP.NET Core website.\n\nIt generates songs word by word (or rather token by token), using\nthe statistical relationships learned by a deep learning model, called\n[GPT-2](https://github.com/openai/gpt-2).\nThe actual generator code is in\n[GradientTextGenerator class](Web/GradientTextGenerator.cs).\n\nText generation is pretty slow even with a powerful GPU,\nso we have a bunch of caches in /Web to provide a better user experience.\nThere is also [PregeneratedSongProvider](Web/PregeneratedSongProvider.cs),\nwhich continuously creates new texts in the background to ensure clicking \n\"Make Random\" button gives an instant result.\n\nDetailed explanation in a [blog post](https://lostmsu.github.io/BillionSongs/)\n\n# Prerequisites\n\n1. Download and install Python and TensorFlow as described in\n[Gradient documentation](https://github.com/losttech/Gradient/#install-python-tensorflow)\n2. Install Python package, called `regex` (`python -m pip install regex --user`)\n3. Install the latest .NET Core SDK\n\n# Run instructions\n\n1. Clone the repository and enter the `Web` folder\n2. .NET Core 3+ only: ensure you have Entity Framework tool installed:\n`dotnet tool install --global dotnet-ef`\n3. After cloning the repository, enter the `Web` folder and run `dotnet ef database update`.\nThat should create `songs.db` file in the same directory.\n4. Edit `appsettings.json` (see `appsettings.Development.json` for an example):\n    - add `\"DB\": \"sqlite\"`\n    - modify `DefaultConnection` to `\"DefaultConnection\": \"Data Source=songs.db\"`\n    - ensure that `Generator` is **not** `dummy`, if you want lyrics to actually be generated\n5. Run `dotnet run web`. This should print some logs.\nWait for `Now listening on: http://`, then open that URL in the browser.\nIt will take up to 4 minutes to generate the first song.\n\n\u003e NOTE: if you see \"Can't choose between the following Python environments, as they are equally matching\",\nset `PYTHON_CONDA_ENV_NAME` to the name of Conda environment where you installed TensorFlow and `regex` modules.\n\n\n# Train instructions\n\n\u003e NOTE: training requires a lot of RAM (\u003e16GB), and will be slow on non-GPU\n\n1. Download the original 117M GPT-2 model by running\none of download_model.* scripts in External/Gradient-Samples/GPT-2\nfrom the same directory.\n2. Download and extract any lyrics dataset (I used \n[Every song you have heard (almost)!](https://www.kaggle.com/artimous/every-song-you-have-heard-almost)),\nand unpack it if needed.\n3. From the command line in the same directory (GPT-2), run\n`dotnet run train --include *.csv --column Lyrics path/to/lyrics/folder --run Lyrics`\n(change the `column` parameter to the name of the lyrics column in you dataset)\n\u003e NOTE: dev instance was trained with `train -i \"*.csv\" --column=Lyrics Downloads\\every-song-you-have-heard-almost -r Lyrics --checkpoint=fresh --save-every=100 -n 3`.\n\u003e If training from IDE, set working directory to GPT-2\n\u003e (which should contain `models` subfolder downloaded previously).\n4. Interrupt training process, when samples start looking good.\n5. Try the trained model by running `dotnet run --run Lyrics`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flosttech%2Fbillionsongs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flosttech%2Fbillionsongs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flosttech%2Fbillionsongs/lists"}