Spaces:
Runtime error
Runtime error
Increased max_length
Browse filesTrying to reduce chances of generating abruptly ended prompts
app.py
CHANGED
@@ -17,7 +17,7 @@ def generate(starting_text):
|
|
17 |
starting_text: str = re.sub(r"[,:\-–.!;?_]", '', starting_text)
|
18 |
print(starting_text)
|
19 |
|
20 |
-
response = gpt2_pipe(starting_text, max_length=random.randint(
|
21 |
response_list = []
|
22 |
for x in response:
|
23 |
resp = x['generated_text'].strip()
|
|
|
17 |
starting_text: str = re.sub(r"[,:\-–.!;?_]", '', starting_text)
|
18 |
print(starting_text)
|
19 |
|
20 |
+
response = gpt2_pipe(starting_text, max_length=random.randint(120, 150), num_return_sequences=4)
|
21 |
response_list = []
|
22 |
for x in response:
|
23 |
resp = x['generated_text'].strip()
|