瀏覽代碼

ngram size = 4

cndn 2 年之前
父節點
當前提交
4c0f004ae3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/seamless_communication/models/inference/translator.py

+ 2 - 2
src/seamless_communication/models/inference/translator.py

@@ -101,8 +101,8 @@ class Translator(nn.Module):
         text_opts = SequenceGeneratorOptions(beam_size=5, soft_max_seq_len=(1, 200))
         unit_opts = SequenceGeneratorOptions(beam_size=5, soft_max_seq_len=(max_len_a, 50))
         if ngram_filtering:
-            text_opts.logits_processor = NGramRepeatBlockLogitsProcessor(no_repeat_ngram_size=10)
-            unit_opts.logits_processor = NGramRepeatBlockLogitsProcessor(no_repeat_ngram_size=10)
+            text_opts.logits_processor = NGramRepeatBlockLogitsProcessor(no_repeat_ngram_size=4)
+            unit_opts.logits_processor = NGramRepeatBlockLogitsProcessor(no_repeat_ngram_size=4)
         generator = UnitYGenerator(
             model,
             text_tokenizer,