Spaces:
Sleeping
Sleeping
Commit
·
cb34ada
1
Parent(s):
e9b122b
Update app.py
Browse files
app.py
CHANGED
@@ -80,7 +80,7 @@ mdl = GPT2LMHeadModel.from_pretrained('gpt2')
|
|
80 |
gpt2_tkn=GPT2Tokenizer.from_pretrained('gpt2')
|
81 |
def generate(starting_text):
|
82 |
tkn_ids = gpt2_tkn.encode(starting_text, return_tensors = 'pt')
|
83 |
-
gpt2_tensors = mdl.generate(tkn_ids,
|
84 |
# response = gpt2_tensors
|
85 |
response=""
|
86 |
for i, x in enumerate(gpt2_tensors):
|
|
|
80 |
gpt2_tkn=GPT2Tokenizer.from_pretrained('gpt2')
|
81 |
def generate(starting_text):
|
82 |
tkn_ids = gpt2_tkn.encode(starting_text, return_tensors = 'pt')
|
83 |
+
gpt2_tensors = mdl.generate(tkn_ids,max_length=100,no_repeat_ngram_size=True,num_beams=3,do_sample=True,temperatue=0.1)
|
84 |
# response = gpt2_tensors
|
85 |
response=""
|
86 |
for i, x in enumerate(gpt2_tensors):
|