Skip to content

Commit

Permalink
add deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MahmoudAshraf97 committed Oct 31, 2024
1 parent 3e7d1b8 commit 9b3800e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions faster_whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from inspect import signature
from math import ceil
from typing import BinaryIO, Iterable, List, Optional, Tuple, Union
from warnings import warn

import ctranslate2
import numpy as np
Expand Down Expand Up @@ -39,6 +40,11 @@ class Word:
probability: float

def _asdict(self):
warn(
"Word._asdict() method is deprecated, use dataclasses.asdict(Word) instead",
DeprecationWarning,
2,
)
return asdict(self)


Expand All @@ -57,6 +63,11 @@ class Segment:
temperature: Optional[float] = 1.0

def _asdict(self):
warn(
"Segment._asdict() method is deprecated, use dataclasses.asdict(Segment) instead",
DeprecationWarning,
2,
)
return asdict(self)


Expand Down

0 comments on commit 9b3800e

Please sign in to comment.