lyrics-transcriber 0.16.1__py3-none-any.whl → 0.16.3__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.
- lyrics_transcriber/transcriber.py +23 -7
- {lyrics_transcriber-0.16.1.dist-info → lyrics_transcriber-0.16.3.dist-info}/METADATA +1 -1
- {lyrics_transcriber-0.16.1.dist-info → lyrics_transcriber-0.16.3.dist-info}/RECORD +6 -6
- {lyrics_transcriber-0.16.1.dist-info → lyrics_transcriber-0.16.3.dist-info}/LICENSE +0 -0
- {lyrics_transcriber-0.16.1.dist-info → lyrics_transcriber-0.16.3.dist-info}/WHEEL +0 -0
- {lyrics_transcriber-0.16.1.dist-info → lyrics_transcriber-0.16.3.dist-info}/entry_points.txt +0 -0
@@ -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:
|
@@ -746,9 +762,6 @@ class LyricsTranscriber:
|
|
746
762
|
if "h264_videotoolbox" in ffmpeg_codes:
|
747
763
|
video_codec = "h264_videotoolbox"
|
748
764
|
self.logger.info(f"video codec set to hardware accelerated h264_videotoolbox")
|
749
|
-
elif "h264_qsv" in ffmpeg_codes:
|
750
|
-
video_codec = "h264_qsv"
|
751
|
-
self.logger.info(f"video codec set to hardware accelerated h264_qsv")
|
752
765
|
|
753
766
|
ffmpeg_cmd += [
|
754
767
|
# Use accompaniment track as audio
|
@@ -958,8 +971,11 @@ class LyricsTranscriber:
|
|
958
971
|
return cache_filepath
|
959
972
|
|
960
973
|
def get_song_slug(self):
|
961
|
-
|
962
|
-
|
974
|
+
if not self.artist and not self.title:
|
975
|
+
return "unknown_song_" + self.get_file_hash(self.audio_filepath)
|
976
|
+
|
977
|
+
artist_slug = slugify.slugify(self.artist or "unknown_artist", lowercase=False)
|
978
|
+
title_slug = slugify.slugify(self.title or "unknown_title", lowercase=False)
|
963
979
|
return artist_slug + "-" + title_slug
|
964
980
|
|
965
981
|
def get_file_hash(self, filepath):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lyrics-transcriber
|
3
|
-
Version: 0.16.
|
3
|
+
Version: 0.16.3
|
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=
|
9
|
+
lyrics_transcriber/transcriber.py,sha256=rI9XRC98kkQNgLwLLQdIs6frSWMXHbRNz8k1bCz47i0,48878
|
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.16.
|
15
|
-
lyrics_transcriber-0.16.
|
16
|
-
lyrics_transcriber-0.16.
|
17
|
-
lyrics_transcriber-0.16.
|
18
|
-
lyrics_transcriber-0.16.
|
14
|
+
lyrics_transcriber-0.16.3.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
|
15
|
+
lyrics_transcriber-0.16.3.dist-info/METADATA,sha256=q3xyPVpQFMbPDIzdfT7fomH3AblhxRR0HxxumYFFfTU,5775
|
16
|
+
lyrics_transcriber-0.16.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
17
|
+
lyrics_transcriber-0.16.3.dist-info/entry_points.txt,sha256=lh6L-iR5CGELaNcouDK94X78eS5Ua_tK9lI4UEkza-k,72
|
18
|
+
lyrics_transcriber-0.16.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{lyrics_transcriber-0.16.1.dist-info → lyrics_transcriber-0.16.3.dist-info}/entry_points.txt
RENAMED
File without changes
|