Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ tokenizer = GPT2Tokenizer.from_pretrained(model_name)
|
|
7 |
|
8 |
def generate(text):
|
9 |
token_ids = tokenizer.encode(text, return_tensors="pt")
|
10 |
-
gpt2_tensors = model.generate(token_ids, max_length=200)
|
11 |
|
12 |
#response= gpt2_tensors
|
13 |
response = ""
|
|
|
7 |
|
8 |
def generate(text):
|
9 |
token_ids = tokenizer.encode(text, return_tensors="pt")
|
10 |
+
gpt2_tensors = model.generate(token_ids, max_length=200, no_repeat_ngram_size=True)
|
11 |
|
12 |
#response= gpt2_tensors
|
13 |
response = ""
|