lyrics-transcriber 0.13.1__tar.gz → 0.14.0__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.
Files changed (16) hide show
  1. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/PKG-INFO +1 -1
  2. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/transcriber.py +14 -3
  3. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/utils/cli.py +2 -2
  4. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/pyproject.toml +1 -1
  5. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/LICENSE +0 -0
  6. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/README.md +0 -0
  7. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/__init__.py +0 -0
  8. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/llm_prompts/README.md +0 -0
  9. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/llm_prompts/llm_prompt_lyrics_correction_andrew_handwritten_20231118.txt +0 -0
  10. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/llm_prompts/llm_prompt_lyrics_correction_gpt_optimised_20231119.txt +0 -0
  11. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/llm_prompts/llm_prompt_lyrics_matching_andrew_handwritten_20231118.txt +0 -0
  12. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/llm_prompts/promptfooconfig.yaml +0 -0
  13. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/llm_prompts/test_data/ABBA-UnderAttack-Genius.txt +0 -0
  14. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/utils/__init__.py +0 -0
  15. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/lyrics_transcriber/utils/ass.py +0 -0
  16. {lyrics_transcriber-0.13.1 → lyrics_transcriber-0.14.0}/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.13.1
3
+ Version: 0.14.0
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
@@ -29,7 +29,7 @@ class LyricsTranscriber:
29
29
  log_level=logging.DEBUG,
30
30
  log_formatter=None,
31
31
  transcription_model="medium",
32
- llm_model="gpt-4-1106-preview",
32
+ llm_model="gpt-4o",
33
33
  llm_prompt_matching="lyrics_transcriber/llm_prompts/llm_prompt_lyrics_matching_andrew_handwritten_20231118.txt",
34
34
  llm_prompt_correction="lyrics_transcriber/llm_prompts/llm_prompt_lyrics_correction_andrew_handwritten_20231118.txt",
35
35
  render_video=False,
@@ -66,7 +66,15 @@ class LyricsTranscriber:
66
66
  self.llm_model = llm_model
67
67
  self.llm_prompt_matching = llm_prompt_matching
68
68
  self.llm_prompt_correction = llm_prompt_correction
69
+
69
70
  self.openai_client = OpenAI()
71
+
72
+ # Uncomment for local models e.g. with ollama
73
+ # self.openai_client = OpenAI(
74
+ # base_url="http://localhost:11434/v1",
75
+ # api_key="ollama",
76
+ # )
77
+
70
78
  self.openai_client.log = self.log_level
71
79
 
72
80
  self.render_video = render_video
@@ -391,8 +399,11 @@ class LyricsTranscriber:
391
399
  },
392
400
  }
393
401
 
394
- input_cost = price_dollars_per_1000_tokens[self.llm_model]["input"] * (self.outputs["llm_token_usage"]["input"] / 1000)
395
- output_cost = price_dollars_per_1000_tokens[self.llm_model]["output"] * (self.outputs["llm_token_usage"]["output"] / 1000)
402
+ input_price = price_dollars_per_1000_tokens.get(self.llm_model, {"input": 0, "output": 0})["input"]
403
+ output_price = price_dollars_per_1000_tokens.get(self.llm_model, {"input": 0, "output": 0})["output"]
404
+
405
+ input_cost = input_price * (self.outputs["llm_token_usage"]["input"] / 1000)
406
+ output_cost = output_price * (self.outputs["llm_token_usage"]["output"] / 1000)
396
407
 
397
408
  self.outputs["llm_costs_usd"]["input"] = round(input_cost, 3)
398
409
  self.outputs["llm_costs_usd"]["output"] = round(output_cost, 3)
@@ -65,8 +65,8 @@ def main():
65
65
 
66
66
  parser.add_argument(
67
67
  "--llm_model",
68
- default="gpt-4-1106-preview",
69
- help="Optional: LLM model to use (currently only supports OpenAI chat completion models, e.g. gpt-4-1106-preview). Default: gpt-3.5-turbo-1106",
68
+ default="gpt-4o",
69
+ help="Optional: LLM model to use (currently only supports OpenAI chat completion compatible models",
70
70
  )
71
71
 
72
72
  parser.add_argument(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "lyrics-transcriber"
3
- version = "0.13.1"
3
+ version = "0.14.0"
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"