Danil commited on
Commit
51138af
β€’
1 Parent(s): 0fa24f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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=5, repetition_penalty=5.0)
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=3.0)
16
  res = tokenizer.decode(out[0])
17
  return res
18