karaokenerds / python-lyrics-transcriber

Automatically create synchronised lyrics files in ASS and MidiCo LRC formats with word-level timestamps, using Whisper and lyrics from Genius and Spotify, using LLMs / GPT-4 to correct transcribed lyrics
MIT License
22 stars 6 forks source link

api key error #3

Open kickaxe60 opened 7 months ago

kickaxe60 commented 7 months ago

I've installed both through pip and local and anytime I run "lyrics-transcriber /path/to/your/audiofile.mp3" I get "openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable" so not sure why as I'm not using Genius. Any help appreciated.

kickaxe60 commented 7 months ago

OK, i fixed the api_key issue but now I'm getting openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}. When I look at the help document listed, it looks like we need a paid chatgpt subscription. Is that the case or am I missing something? Also, is a Genius api key or spotify cookie required? Can I provide my own lyrics txt file? This looks cool but I'm lacking the info I need to get it going. I am a bit of a noob but I think I'm getting pretty close. I don't think this is just a matter of "pip install lyrics-transcriber" and then "lyrics-transcriber /path/to/your/audiofile.mp3". I suspect there is a bit more setup required. If you could point me in the right direction, I would really appreciate that. Regards...

beveradb commented 7 months ago

Hey, thanks for trying it out - sorry for the bad experience, you're totally right, I haven't updated the README since adding more functionality recently. I'll fix that later today when I get some hobby time.

What are you trying to achieve, though? I should warn you, this project is still very much a work in progress; the challenge of syncing the words with the audio is an unsolved one which I've been trying to solve using a combo of Whisper transcription, then prompting GPT-4 for each segment to try and get it to correct the transcribed lyrics using the known lyrics from Spotify, Genius, etc.

Some explanation in this issue: https://github.com/karaokenerds/python-lyrics-transcriber/issues/1 and this one: https://github.com/karaokenerds/python-lyrics-transcriber/issues/2

The last version before I started doing the LLM-based correction work was October, if you want to try that older version - but as mentioned above, there's still more work to do to make this project generally useful to anyone! https://github.com/karaokenerds/python-lyrics-transcriber/releases/tag/v0.8.0

kickaxe60 commented 7 months ago

Hey thanks for responding Andrew. I'm also kind of a karaoke "nerd" and just looking for ways to automate some of the processes used to make decent "homemade" karaoke, strictly for personal use. Things have come a long way with software like Ultimate Vocal Remover 5 and The-Tuul. I can make a decent karaoke video in less than an hour with these tools. I came across your project and thought that it would be even better if I could quickly get an .ass file to work from as opposed to manually creating one with The-Tuul. Don't get me wrong, I love The-Tuul, but if I can expedite things, I will... There is also another online service called Croonify (croonify.com) which seems to automate the creation of the lyrics timings but you don't get anything back other than a finished video in about 10 minutes, so no insight as to what process is used. Although it is currently free, it will eventually be a paid service when they get the bugs ironed out. It's not perfect, but it's getting very close. Currently my process is to get a decent instrumental, lead vocal, and sometimes a fairly good backing vocal track from UVR5 using a good quality audio file (if you have any insight as how to get a good solid backing vocal only track let me know as sometimes it's hit or miss.) I then use the .ass file I get from The-Tuul to tweak as required and reformat it with a python script to display the lyrics the way I want them to appear on-screen and then use ffmpeg to create the video using the .ass file with the three audio sources to different channels. I can then play the video with the MPV media player with a lua script to bind keys to control pitch, speed changes, volume of tracks 1, 2, and/or 3 (kinda like the Karafun player). It all works well, but I'm always looking for ways to improve. Anyway, I'll keep an eye this to see where it goes. Take care.

porg commented 5 months ago