zhifu gao
2024-04-24 861147c7308b91068ffa02724fdf74ee623a909e
funasr/models/fsmn_vad_streaming/export_meta.py
@@ -22,11 +22,13 @@
    return model
def export_forward(self, feats: torch.Tensor, *args, **kwargs):
    
    scores, out_caches = self.encoder(feats, *args)
    
    return scores, out_caches
def export_dummy_inputs(self, data_in=None, frame=30):
    if data_in is None:
@@ -42,18 +44,22 @@
    
    return (speech, in_cache0, in_cache1, in_cache2, in_cache3)
def export_input_names(self):
    return ['speech', 'in_cache0', 'in_cache1', 'in_cache2', 'in_cache3']
    return ["speech", "in_cache0", "in_cache1", "in_cache2", "in_cache3"]
def export_output_names(self):
    return ['logits', 'out_cache0', 'out_cache1', 'out_cache2', 'out_cache3']
    return ["logits", "out_cache0", "out_cache1", "out_cache2", "out_cache3"]
def export_dynamic_axes(self):
    return {
        'speech': {
            1: 'feats_length'
        },
        "speech": {1: "feats_length"},
    }
def export_name(self, ):
def export_name(
    self,
):
    return "model.onnx"