Added retrieval mechanism (avg_log_prob/no_speech_prob) (#103)

* Added retrieval mechanism 

Added retrieval mechanism to retrieve avg_log_prob and no_speech_prob from the Transcribe method.

* Update transcribe.py

* Update transcribe.py

* Initial commit
This commit is contained in:
palladium123
2023-04-03 22:56:35 +08:00
committed by GitHub
parent f20bb258de
commit b4c1c57781

View File

@@ -26,6 +26,8 @@ class Segment(NamedTuple):
end: float
text: str
words: Optional[List[Word]]
avg_log_prob: float
no_speech_prob: float
class AudioInfo(NamedTuple):
@@ -441,6 +443,8 @@ class WhisperModel:
if options.word_timestamps
else None
),
avg_log_prob=avg_log_prob,
no_speech_prob=result.no_speech_prob,
)
def encode(self, features: np.ndarray) -> ctranslate2.StorageView: