Spaces:
Runtime error
Runtime error
Danil
commited on
Commit
β’
962bbdd
1
Parent(s):
51138af
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, num_beams=
|
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=2, repetition_penalty=2.0)
|
16 |
res = tokenizer.decode(out[0])
|
17 |
return res
|
18 |
|