Ateeqq commited on
Commit
3ad2c2b
1 Parent(s): 3bd3f8b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -50,8 +50,8 @@ device = "cuda"
50
  tokenizer = AutoTokenizer.from_pretrained("Ateeqq/keywords-title-generator", token='your_token')
51
  model = AutoModelForSeq2SeqLM.from_pretrained("Ateeqq/keywords-title-generator", token='your_token').to(device)
52
 
53
- def generate_title(question):
54
- input_ids = tokenizer(f'generate title: {question}', return_tensors="pt", padding="longest", truncation=True, max_length=24).input_ids.to(device)
55
  outputs = model.generate(
56
  input_ids,
57
  num_beams=5,
@@ -65,8 +65,8 @@ def generate_title(question):
65
  )
66
  return tokenizer.batch_decode(outputs, skip_special_tokens=True)
67
 
68
- text = 'book, history, kids'
69
- generate_title(text)
70
  ```
71
  ### Output:
72
  ```
 
50
  tokenizer = AutoTokenizer.from_pretrained("Ateeqq/keywords-title-generator", token='your_token')
51
  model = AutoModelForSeq2SeqLM.from_pretrained("Ateeqq/keywords-title-generator", token='your_token').to(device)
52
 
53
+ def generate_title(keywords):
54
+ input_ids = tokenizer(f'generate title: {keywords}', return_tensors="pt", padding="longest", truncation=True, max_length=24).input_ids.to(device)
55
  outputs = model.generate(
56
  input_ids,
57
  num_beams=5,
 
65
  )
66
  return tokenizer.batch_decode(outputs, skip_special_tokens=True)
67
 
68
+ keywords = 'book, history, kids'
69
+ generate_title(keywords)
70
  ```
71
  ### Output:
72
  ```