TrLOX commited on
Commit
9c9e3b5
·
1 Parent(s): 6ef97ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -8,7 +8,7 @@ model = AutoModelForCausalLM.from_pretrained('TrLOX/gpt2-tdk')
8
 
9
  def text_generation(keywords, domain):
10
  input_ids = tokenizer('keyword ' + keywords + ' domain ' + domain + ' title', return_tensors="pt").input_ids
11
- torch.manual_seed(random.seed(18446744073709551615))
12
  outputs = model.generate(input_ids, do_sample=True, min_length=50, max_length=250)
13
  generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)
14
  return generated_text[0]
 
8
 
9
  def text_generation(keywords, domain):
10
  input_ids = tokenizer('keyword ' + keywords + ' domain ' + domain + ' title', return_tensors="pt").input_ids
11
+ torch.manual_seed(random.randint(0,18446744073709551615))
12
  outputs = model.generate(input_ids, do_sample=True, min_length=50, max_length=250)
13
  generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)
14
  return generated_text[0]