lyrics-transcriber 0.17.1__py3-none-any.whl → 0.17.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -308,6 +308,13 @@ class LyricsTranscriber:
308
308
  self.outputs["corrected_lyrics_data_dict"] = corrected_lyrics_data_dict
309
309
  return
310
310
 
311
+ reference_lyrics = self.outputs.get("genius_lyrics_text") or self.outputs.get("spotify_lyrics_text")
312
+
313
+ if not reference_lyrics:
314
+ self.logger.warning("No reference lyrics found from Genius or Spotify. Skipping LLM correction.")
315
+ self.outputs["corrected_lyrics_data_dict"] = self.outputs["transcription_data_dict"]
316
+ return
317
+
311
318
  self.logger.debug(
312
319
  f"no cached lyrics found at corrected_lyrics_data_json_cache_filepath: {corrected_lyrics_data_json_cache_filepath}, attempting to run correction using LLM"
313
320
  )
@@ -317,7 +324,6 @@ class LyricsTranscriber:
317
324
  with open(self.llm_prompt_correction, "r") as file:
318
325
  system_prompt_template = file.read()
319
326
 
320
- reference_lyrics = self.outputs["genius_lyrics_text"] or self.outputs["spotify_lyrics_text"]
321
327
  system_prompt = system_prompt_template.replace("{{reference_lyrics}}", reference_lyrics)
322
328
 
323
329
  # TODO: Test if results are cleaner when using the vocal file from a background vocal audio separation model
@@ -639,7 +645,9 @@ class LyricsTranscriber:
639
645
  for i, word in enumerate(segment["words"]):
640
646
  start_time = self.format_time_lrc(word["start"])
641
647
  if i != len(segment["words"]) - 1:
642
- word["text"] += " "
648
+ if not word["text"].endswith(" "):
649
+ self.logger.debug(f"word '{word['text']}' does not end with a space, adding one")
650
+ word["text"] += " "
643
651
  line = "[{}]1:{}{}\n".format(start_time, "/" if i == 0 else "", word["text"])
644
652
  f.write(line)
645
653
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lyrics-transcriber
3
- Version: 0.17.1
3
+ Version: 0.17.2
4
4
  Summary: Automatically create synchronised lyrics files in ASS and MidiCo LRC formats with word-level timestamps, using Whisper and lyrics from Genius and Spotify
5
5
  Home-page: https://github.com/karaokenerds/python-lyrics-transcriber
6
6
  License: MIT
@@ -6,13 +6,13 @@ lyrics_transcriber/llm_prompts/llm_prompt_lyrics_correction_gpt_optimised_202311
6
6
  lyrics_transcriber/llm_prompts/llm_prompt_lyrics_matching_andrew_handwritten_20231118.txt,sha256=hvk2Vs3M3Q4zGQsiQnXvnpd8wXWfwsudYeqN5qFyNWs,1754
7
7
  lyrics_transcriber/llm_prompts/promptfooconfig.yaml,sha256=O4YxlLV7XSUiSw_1Q9G7ELC2VAbrYUV_N5QxrPbd1jE,3735
8
8
  lyrics_transcriber/llm_prompts/test_data/ABBA-UnderAttack-Genius.txt,sha256=8d-RvZtyINKUlpQLwMi-VD--Y59J-epPt7SZSqjFbPI,1690
9
- lyrics_transcriber/transcriber.py,sha256=5gLV1WtQffKZ9d8mL3cZh8b-VhtUKHv-QZw7Cv3VYl4,49962
9
+ lyrics_transcriber/transcriber.py,sha256=7aTglPHnq_vDsgmbk9x9C2qM7WMZSmq3a82Uz062ZqE,50404
10
10
  lyrics_transcriber/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  lyrics_transcriber/utils/ass.py,sha256=b8lnjgXGD1OD1ld_b1xxUmSOf4nSEfz9BpgSkh16R4g,90291
12
12
  lyrics_transcriber/utils/cli.py,sha256=8Poba_9wQw0VmOK73vuK-w-abR9QmO4y4FYDHiAQbc0,6972
13
13
  lyrics_transcriber/utils/subtitles.py,sha256=_WG0pFoZMXcrGe6gbARkC9KrWzFNTMOsiqQwNL-H2lU,11812
14
- lyrics_transcriber-0.17.1.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
15
- lyrics_transcriber-0.17.1.dist-info/METADATA,sha256=SDOYYEWiwhiBxnrpMWg2uaHyrHdn_pQOlO8Tuz-V1jE,5805
16
- lyrics_transcriber-0.17.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
17
- lyrics_transcriber-0.17.1.dist-info/entry_points.txt,sha256=lh6L-iR5CGELaNcouDK94X78eS5Ua_tK9lI4UEkza-k,72
18
- lyrics_transcriber-0.17.1.dist-info/RECORD,,
14
+ lyrics_transcriber-0.17.2.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
15
+ lyrics_transcriber-0.17.2.dist-info/METADATA,sha256=WuNak2-sXmZrWIYkrbRSnraWfzTVyJnkat9ojPoa2GI,5805
16
+ lyrics_transcriber-0.17.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
17
+ lyrics_transcriber-0.17.2.dist-info/entry_points.txt,sha256=lh6L-iR5CGELaNcouDK94X78eS5Ua_tK9lI4UEkza-k,72
18
+ lyrics_transcriber-0.17.2.dist-info/RECORD,,