Spaces:
Sleeping
Sleeping
Commit
·
9dd47e3
1
Parent(s):
246fe06
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ model = GPT2LMHeadModel.from_pretrained('DarwinAnim8or/gpt-grug-1.5b', use_auth_
|
|
13 |
# Define the function that generates text from a prompt
|
14 |
def generate_text(prompt):
|
15 |
input_ids = tokenizer.encode(prompt, return_tensors='pt')
|
16 |
-
output = model.generate(input_ids,
|
17 |
text = tokenizer.decode(output[0], skip_special_tokens=True)
|
18 |
return text
|
19 |
|
|
|
13 |
# Define the function that generates text from a prompt
|
14 |
def generate_text(prompt):
|
15 |
input_ids = tokenizer.encode(prompt, return_tensors='pt')
|
16 |
+
output = model.generate(input_ids, max_new_tokens=80, do_sample=True)
|
17 |
text = tokenizer.decode(output[0], skip_special_tokens=True)
|
18 |
return text
|
19 |
|