Run some automatic tests with GitHub Actions (#68)

This commit is contained in:
Guillaume Klein
2023-03-22 20:50:03 +01:00
committed by GitHub
parent 52264f2277
commit 66efd02bd0
9 changed files with 143 additions and 2 deletions

View File

@@ -1,2 +1,9 @@
from faster_whisper.audio import decode_audio
from faster_whisper.transcribe import WhisperModel
from faster_whisper.utils import format_timestamp
__all__ = [
"decode_audio",
"WhisperModel",
"format_timestamp",
]

View File

@@ -1,7 +1,7 @@
import numpy as np
# Adapted from https://github.com/huggingface/transformers/blob/main/src/transformers/models/whisper/feature_extraction_whisper.py
# Adapted from https://github.com/huggingface/transformers/blob/main/src/transformers/models/whisper/feature_extraction_whisper.py # noqa: E501
class FeatureExtractor:
def __init__(
self,

View File

@@ -2,7 +2,7 @@ def format_timestamp(
seconds: float,
always_include_hours: bool = False,
decimal_marker: str = ".",
):
) -> str:
assert seconds >= 0, "non-negative timestamp expected"
milliseconds = round(seconds * 1000.0)