max_length

#1
by nora1008 - opened

hi I want to know I set the max_length=2000 but it only get 200 words what can I do ?

Stanford Open Virtual Assistant Lab (OVAL) org
edited Sep 25, 2022

max_length is the maximum length of the output, i.e. the only guarantee with max_length=2000 is that there won't be more than 2000 tokens in the output.
The actual length of the output depends on what is a meaningful output given the input (in the case of paraphrasing, the output length will be similar to the input length).
Also, this model is fine-tuned from facebook/bart-large, and as you can see in max_position_embeddings in its config file, only supports inputs and outputs of length up to 1024 tokens. Meaning that max_length above 1024 is treated the same as max_length=1024.

@s-jse thx for your help <3
I input 1,111 words but I get only 200 words I think if it over the its config file that only supports max_length=1024 ?

Stanford Open Virtual Assistant Lab (OVAL) org
edited Sep 26, 2022

Yes, the theoretical maximum supported is 1024 tokens. Another factor that might be affecting the output you are getting, is that the model has been fine-tuned on single sentences. This means that the model has not seen longer outputs (anything longer than the normal length of an English sentence) during its training, so does not really know how to handle very long inputs.
If your application requires paraphrasing paragraphs, I recommend first breaking down the input to individual sentences, then feeding it sentence by sentence to the model.

I tried new paragraphs (144 words) but some sentences are omitted (no output) and I paraphrase the omitted sentences again and it works, I don't know what makes the model "skip" it
and some paragraphs (154 words) only paraphrase (output) the first 1/3 and I breaking down the input to individual sentences ,then feeding it sentence by sentence to the model as you said is OK

s-jse changed discussion status to closed

Sign up or log in to comment