forked from facebookresearch/omnilingual-asr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterop.py
More file actions
23 lines (16 loc) · 789 Bytes
/
interop.py
File metadata and controls
23 lines (16 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
from typing import Dict
from fairseq2.models.wav2vec2.asr import convert_wav2vec2_asr_state_dict
from omnilingual_asr.models.wav2vec2_llama.config import Wav2Vec2LlamaConfig
def convert_wav2vec2_llama_state_dict(
state_dict: Dict[str, object], config: Wav2Vec2LlamaConfig
) -> Dict[str, object]:
"""Using the fs2:wav2vec2_asr implementation until breaking changes arise. Replace with custom loading if necessary."""
return convert_wav2vec2_asr_state_dict(
state_dict=state_dict, config=config.wav2vec2_asr_config
)