Commit ·
b80c519
1
Parent(s): a143715
max_length calculation change to account for Initial Text length (#4)
Browse files- max_length calculation change to account for Initial Text length (8923bc56d5eda78169ecd7f9bcbec8c73956f84b)
Co-authored-by: John <ZWEi-P@users.noreply.huggingface.co>
16 unmodified lines171819202021222316 unmodified lines starting_text: str = re.sub(r"[,:\-–.!;?_]", '', starting_text) print(starting_text) response = gpt2_pipe(starting_text, max_length=random.randint(60, 90), num_return_sequences=4) response = gpt2_pipe(starting_text, max_length=(len(starting_text) + random.randint(60, 90)), num_return_sequences=4) response_list = [] for x in response: resp = x['generated_text'].strip()app.py+1-1