lyrics-transcriber 0.13.1__py3-none-any.whl → 0.14.0__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.
@@ -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
  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
@@ -5,13 +5,13 @@ lyrics_transcriber/llm_prompts/llm_prompt_lyrics_correction_gpt_optimised_202311
5
5
  lyrics_transcriber/llm_prompts/llm_prompt_lyrics_matching_andrew_handwritten_20231118.txt,sha256=hvk2Vs3M3Q4zGQsiQnXvnpd8wXWfwsudYeqN5qFyNWs,1754
6
6
  lyrics_transcriber/llm_prompts/promptfooconfig.yaml,sha256=O4YxlLV7XSUiSw_1Q9G7ELC2VAbrYUV_N5QxrPbd1jE,3735
7
7
  lyrics_transcriber/llm_prompts/test_data/ABBA-UnderAttack-Genius.txt,sha256=8d-RvZtyINKUlpQLwMi-VD--Y59J-epPt7SZSqjFbPI,1690
8
- lyrics_transcriber/transcriber.py,sha256=YrDx8OhVV6UUljuDic4DmBsQnkalH-iBUFX2Svl7L1U,38915
8
+ lyrics_transcriber/transcriber.py,sha256=M-ybGCdOHeNsTtptizsL-VnA_7tcrGtrOZmlfuqS2Nk,39228
9
9
  lyrics_transcriber/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  lyrics_transcriber/utils/ass.py,sha256=b8lnjgXGD1OD1ld_b1xxUmSOf4nSEfz9BpgSkh16R4g,90291
11
- lyrics_transcriber/utils/cli.py,sha256=RaZieUW9NuajCq3nU5IvBa-NgFCQ27wraUgrKqOfe7M,6512
11
+ lyrics_transcriber/utils/cli.py,sha256=Z9bkR-l5f_rA-EjV0Z1kaLyEatsbmvMoACUznsXeGrk,6456
12
12
  lyrics_transcriber/utils/subtitles.py,sha256=GPLbo9oX3WJIY4wRO40k0RZF-UqvKjr2LFnXVOS0RHI,10762
13
- lyrics_transcriber-0.13.1.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
14
- lyrics_transcriber-0.13.1.dist-info/METADATA,sha256=j426j7GVyhXPl0kb26Zs6LXYJovCunPRW8iH1YFX0Q0,5047
15
- lyrics_transcriber-0.13.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
16
- lyrics_transcriber-0.13.1.dist-info/entry_points.txt,sha256=lh6L-iR5CGELaNcouDK94X78eS5Ua_tK9lI4UEkza-k,72
17
- lyrics_transcriber-0.13.1.dist-info/RECORD,,
13
+ lyrics_transcriber-0.14.0.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
14
+ lyrics_transcriber-0.14.0.dist-info/METADATA,sha256=b6H_X9RItUITL49zjmzhzxPAgDPSstObuNzBu6A5KwM,5047
15
+ lyrics_transcriber-0.14.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
16
+ lyrics_transcriber-0.14.0.dist-info/entry_points.txt,sha256=lh6L-iR5CGELaNcouDK94X78eS5Ua_tK9lI4UEkza-k,72
17
+ lyrics_transcriber-0.14.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.8.1
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any