Skip to content

Commit

Permalink
Rename functions to get_
Browse files Browse the repository at this point in the history
  • Loading branch information
jhj0517 committed Nov 16, 2024
1 parent ae4c8fa commit 3e54c1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions backend/bgm_separation/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


@functools.lru_cache
def init_bgm_separation_inferencer() -> 'MusicSeparator':
def get_bgm_separation_inferencer() -> 'MusicSeparator':
config = load_server_config()["bgm_separation"]
inferencer = MusicSeparator()
inferencer.update_model(
Expand All @@ -33,7 +33,7 @@ async def run_bgm_separation(
audio: np.ndarray,
params: BGMSeparationParams
) -> Tuple[np.ndarray, np.ndarray]:
instrumental, vocal, filepaths = init_bgm_separation_inferencer().separate(
instrumental, vocal, filepaths = get_bgm_separation_inferencer().separate(
audio=audio,
model_name=params.model_size,
device=params.device,
Expand Down
4 changes: 2 additions & 2 deletions backend/transcription/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


@functools.lru_cache
def init_pipeline() -> 'FasterWhisperInference':
def get_pipeline() -> 'FasterWhisperInference':
config = load_server_config()["whisper"]
inferencer = FasterWhisperInference()
inferencer.update_model(
Expand All @@ -33,7 +33,7 @@ async def run_transcription(
audio: np.ndarray,
params: TranscriptionPipelineParams
) -> List[Segment]:
segments, elapsed_time = init_pipeline().run(
segments, elapsed_time = get_pipeline().run(
audio=audio,
progress=gr.Progress(),
add_timestamp=False,
Expand Down
4 changes: 2 additions & 2 deletions backend/vad/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@functools.lru_cache
def init_vad_model() -> SileroVAD:
def get_vad_model() -> SileroVAD:
inferencer = SileroVAD()
inferencer.update_model()
return inferencer
Expand All @@ -27,7 +27,7 @@ async def run_vad(
audio: np.ndarray,
params: VadOptions
) -> List[Dict]:
audio, speech_chunks = init_vad_model().run(
audio, speech_chunks = get_vad_model().run(
audio=audio,
vad_parameters=params
)
Expand Down

0 comments on commit 3e54c1a

Please sign in to comment.