Spaces:
Runtime error
Runtime error
Danil
commited on
Commit
β’
042bfa4
1
Parent(s):
36fd46e
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ print('load ok')
|
|
12 |
def completion(prompt, max_tokens, temperature, top_k, top_p):
|
13 |
inpt = tokenizer.encode(prompt, return_tensors="pt")
|
14 |
tok = len(tokenizer(prompt)['input_ids'])
|
15 |
-
out = model.generate(inpt, max_length=tok+max_tokens, top_p=top_p, top_k=top_k, temperature=temperature)
|
16 |
res = tokenizer.decode(out[0])
|
17 |
return res
|
18 |
|
|
|
12 |
def completion(prompt, max_tokens, temperature, top_k, top_p):
|
13 |
inpt = tokenizer.encode(prompt, return_tensors="pt")
|
14 |
tok = len(tokenizer(prompt)['input_ids'])
|
15 |
+
out = model.generate(inpt, max_length=tok+max_tokens, top_p=top_p, top_k=top_k, temperature=temperature, num_beams=3, repetition_penalty=1.5)
|
16 |
res = tokenizer.decode(out[0])
|
17 |
return res
|
18 |
|