Update app.py
Browse files
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.
|
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]
|