lyrics-transcriber 0.16.1__tar.gz → 0.16.2__tar.gz
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.
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/PKG-INFO +1 -1
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/transcriber.py +23 -4
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/pyproject.toml +1 -1
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/LICENSE +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/README.md +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/__init__.py +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/audioshake_transcriber.py +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/llm_prompts/README.md +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/llm_prompts/llm_prompt_lyrics_correction_andrew_handwritten_20231118.txt +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/llm_prompts/llm_prompt_lyrics_correction_gpt_optimised_20231119.txt +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/llm_prompts/llm_prompt_lyrics_matching_andrew_handwritten_20231118.txt +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/llm_prompts/promptfooconfig.yaml +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/llm_prompts/test_data/ABBA-UnderAttack-Genius.txt +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/utils/__init__.py +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/utils/ass.py +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/utils/cli.py +0 -0
- {lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/utils/subtitles.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lyrics-transcriber
|
3
|
-
Version: 0.16.
|
3
|
+
Version: 0.16.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
|
@@ -32,8 +32,8 @@ class LyricsTranscriber:
|
|
32
32
|
log_formatter=None,
|
33
33
|
transcription_model="medium",
|
34
34
|
llm_model="gpt-4o",
|
35
|
-
llm_prompt_matching=
|
36
|
-
llm_prompt_correction=
|
35
|
+
llm_prompt_matching=None,
|
36
|
+
llm_prompt_correction=None,
|
37
37
|
render_video=False,
|
38
38
|
video_resolution="360p",
|
39
39
|
video_background_image=None,
|
@@ -68,9 +68,25 @@ class LyricsTranscriber:
|
|
68
68
|
|
69
69
|
self.transcription_model = transcription_model
|
70
70
|
self.llm_model = llm_model
|
71
|
+
|
72
|
+
# Use package-relative paths for prompt files
|
73
|
+
if llm_prompt_matching is None:
|
74
|
+
llm_prompt_matching = os.path.join(
|
75
|
+
os.path.dirname(__file__), "llm_prompts", "llm_prompt_lyrics_matching_andrew_handwritten_20231118.txt"
|
76
|
+
)
|
77
|
+
if llm_prompt_correction is None:
|
78
|
+
llm_prompt_correction = os.path.join(
|
79
|
+
os.path.dirname(__file__), "llm_prompts", "llm_prompt_lyrics_correction_andrew_handwritten_20231118.txt"
|
80
|
+
)
|
81
|
+
|
71
82
|
self.llm_prompt_matching = llm_prompt_matching
|
72
83
|
self.llm_prompt_correction = llm_prompt_correction
|
73
84
|
|
85
|
+
if not os.path.exists(self.llm_prompt_matching):
|
86
|
+
raise FileNotFoundError(f"LLM prompt file not found: {self.llm_prompt_matching}")
|
87
|
+
if not os.path.exists(self.llm_prompt_correction):
|
88
|
+
raise FileNotFoundError(f"LLM prompt file not found: {self.llm_prompt_correction}")
|
89
|
+
|
74
90
|
self.openai_client = None
|
75
91
|
|
76
92
|
if self.openai_api_key:
|
@@ -958,8 +974,11 @@ class LyricsTranscriber:
|
|
958
974
|
return cache_filepath
|
959
975
|
|
960
976
|
def get_song_slug(self):
|
961
|
-
|
962
|
-
|
977
|
+
if not self.artist and not self.title:
|
978
|
+
return "unknown_song_" + self.get_file_hash(self.audio_filepath)
|
979
|
+
|
980
|
+
artist_slug = slugify.slugify(self.artist or "unknown_artist", lowercase=False)
|
981
|
+
title_slug = slugify.slugify(self.title or "unknown_title", lowercase=False)
|
963
982
|
return artist_slug + "-" + title_slug
|
964
983
|
|
965
984
|
def get_file_hash(self, filepath):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "lyrics-transcriber"
|
3
|
-
version = "0.16.
|
3
|
+
version = "0.16.2"
|
4
4
|
description = "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
|
authors = ["Andrew Beveridge <andrew@beveridge.uk>"]
|
6
6
|
license = "MIT"
|
File without changes
|
File without changes
|
File without changes
|
{lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/audioshake_transcriber.py
RENAMED
File without changes
|
{lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/llm_prompts/README.md
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/utils/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{lyrics_transcriber-0.16.1 → lyrics_transcriber-0.16.2}/lyrics_transcriber/utils/subtitles.py
RENAMED
File without changes
|