Commit 244e506e by xuchen

fix the bug of circular import

parent 5fb50cc3
ctc-weight: 0.2
intermedia-ctc-weight: 0.1
intermedia-ctc-layers: 2,4
#target-ctc-weight: 0.3
#target-ctc-layer: 6
#target-intermedia-ctc-weight: 0.1
#target-intermedia-ctc-layers: 2,4
intermedia-adapter: league
#intermedia-drop-prob: 0.2
#intermedia-temperature: 5
post-process: sentencepiece
\ No newline at end of file
ctc-weight: 0.2 ctc-weight: 0.2
intermedia-ctc-weight: 0.1
intermedia-ctc-layers: 6,9 intermedia-ctc-layers: 6,9
#target-ctc-weight: 0.3
#target-ctc-layer: 6
#target-intermedia-ctc-weight: 0.1
#target-intermedia-ctc-layers: 2,4
intermedia-adapter: league intermedia-adapter: league
intermedia-ctc-weight: 0.1
#intermedia-drop-prob: 0.2 #intermedia-drop-prob: 0.2
#intermedia-temperature: 5 #intermedia-temperature: 5
#target-ctc-weight: 0.5
#target-ctc-layers: 2,4,6
ctc-self-distill-weight: 0 ctc-self-distill-weight: 0
post-process: sentencepiece post-process: sentencepiece
\ No newline at end of file
...@@ -14,7 +14,7 @@ from fairseq.models import ( ...@@ -14,7 +14,7 @@ from fairseq.models import (
register_model_architecture, register_model_architecture,
) )
from fairseq.models.speech_to_text import S2TTransformerModel from fairseq.models.speech_to_text import S2TTransformerModel
from fairseq.models.speech_to_text.modules import CTC, Adapter from fairseq.modules.speech_to_text import CTC, Adapter
from fairseq.modules import ( from fairseq.modules import (
FairseqDropout, FairseqDropout,
......
...@@ -28,7 +28,7 @@ from fairseq.models.speech_to_text import ( ...@@ -28,7 +28,7 @@ from fairseq.models.speech_to_text import (
PDSS2TTransformerEncoder, PDSS2TTransformerEncoder,
S2TSATEEncoder, S2TSATEEncoder,
) )
from fairseq.models.speech_to_text.modules import Adapter, CTC from fairseq.modules.speech_to_text import Adapter, CTC
from fairseq.models.transformer_s2 import ( from fairseq.models.transformer_s2 import (
Embedding, Embedding,
TransformerS2Encoder, TransformerS2Encoder,
......
...@@ -16,7 +16,7 @@ from fairseq.models.speech_to_text import ( ...@@ -16,7 +16,7 @@ from fairseq.models.speech_to_text import (
PDSS2TTransformerModel, PDSS2TTransformerModel,
PDSS2TTransformerEncoder, PDSS2TTransformerEncoder,
) )
from fairseq.models.speech_to_text.modules import Adapter, CTC from fairseq.modules.speech_to_text import Adapter, CTC
from fairseq.modules import ( from fairseq.modules import (
FairseqDropout, FairseqDropout,
LayerNorm, LayerNorm,
...@@ -184,7 +184,7 @@ class TextEncoder(FairseqEncoder): ...@@ -184,7 +184,7 @@ class TextEncoder(FairseqEncoder):
# CTC # CTC
self.use_ctc = getattr(args, "target_ctc_weight", 0) > 0 self.use_ctc = getattr(args, "target_ctc_weight", 0) > 0
if self.use_ctc: if self.use_ctc:
self.ctc_layer = args.target_ctc_layer self.ctc_layer = getattr(args, "target_ctc_layer", layer_num)
self.inter_ctc = True if self.ctc_layer != args.encoder_layers else False self.inter_ctc = True if self.ctc_layer != args.encoder_layers else False
if self.inter_ctc: if self.inter_ctc:
logger.info("Target CTC loss in layer %d" % self.ctc_layer) logger.info("Target CTC loss in layer %d" % self.ctc_layer)
......
...@@ -14,7 +14,7 @@ from fairseq.models import ( ...@@ -14,7 +14,7 @@ from fairseq.models import (
register_model, register_model,
register_model_architecture, register_model_architecture,
) )
from fairseq.models.speech_to_text.modules import Adapter, CTC from fairseq.modules.speech_to_text import Adapter, CTC
from fairseq.models.transformer import Embedding, TransformerDecoder from fairseq.models.transformer import Embedding, TransformerDecoder
from fairseq.modules import ( from fairseq.modules import (
FairseqDropout, FairseqDropout,
......
...@@ -18,7 +18,7 @@ from fairseq.models import ( ...@@ -18,7 +18,7 @@ from fairseq.models import (
register_model, register_model,
register_model_architecture, register_model_architecture,
) )
from fairseq.models.speech_to_text.modules import Adapter, CTC from fairseq.modules.speech_to_text import Adapter, CTC
from fairseq.modules import ( from fairseq.modules import (
AdaptiveSoftmax, AdaptiveSoftmax,
FairseqDropout, FairseqDropout,
......
from .subsampling import * from .subsampling import *
from .ctc import *
from .adapter import *
\ No newline at end of file
import logging import logging
import math
import torch import torch
import torch.nn as nn import torch.nn as nn
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论