the-hir0 commited on
Commit
bdf28f7
1 Parent(s): 1f795b7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -3
README.md CHANGED
@@ -3,6 +3,7 @@ license: apache-2.0
3
  ---
4
  Text Detoxification Task is a process of transforming the text with toxic style into the text with the same meaning but with neutral style
5
 
 
6
  # Load model directly
7
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
8
 
@@ -11,6 +12,7 @@ device = 'cuda' if torch.cuda.is_available() else 'cpu'
11
  tokenizer = AutoTokenizer.from_pretrained("the-hir0/t5-small-detoxify")
12
  model = AutoModelForSeq2SeqLM.from_pretrained("the-hir0/t5-small-detoxify").to(device)
13
 
14
- input_ids = tokenizer(inference_request, return_tensors="pt", padding=True).input_ids.to(device)
15
- outputs = model.generate(input_ids=input_ids)
16
- return tokenizer.batch_decode(outputs, skip_special_tokens=True,temperature=0)
 
 
3
  ---
4
  Text Detoxification Task is a process of transforming the text with toxic style into the text with the same meaning but with neutral style
5
 
6
+ ```
7
  # Load model directly
8
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
9
 
 
12
  tokenizer = AutoTokenizer.from_pretrained("the-hir0/t5-small-detoxify")
13
  model = AutoModelForSeq2SeqLM.from_pretrained("the-hir0/t5-small-detoxify").to(device)
14
 
15
+ input_ids = tokenizer(inference_request, return_tensors="pt", padding=True).input_ids.to(device)
16
+ outputs = model.generate(input_ids=input_ids)
17
+ tokenizer.batch_decode(outputs, skip_special_tokens=True,temperature=0)
18
+ ```