Update README.md
Browse files
README.md
CHANGED
@@ -21,8 +21,7 @@ pipeline_tag: text2text-generation
|
|
21 |
# mT0-XL-detox-orpo
|
22 |
|
23 |
**Resources**:
|
24 |
-
|
25 |
-
* [Paper]()
|
26 |
* [GitHub with training scripts and data](https://github.com/s-nlp/multilingual-transformer-detoxification)
|
27 |
|
28 |
## Model Information
|
@@ -49,7 +48,7 @@ tokenizer = AutoTokenizer.from_pretrained('s-nlp/mt0-xl-detox-orpo')
|
|
49 |
}
|
50 |
|
51 |
def detoxify(text, lang, model, tokenizer):
|
52 |
-
encodings = tokenizer(LANG_PROMPTS[lang] +
|
53 |
|
54 |
outputs = model.generate(**encodings.to(model.device),
|
55 |
max_length=128,
|
|
|
21 |
# mT0-XL-detox-orpo
|
22 |
|
23 |
**Resources**:
|
24 |
+
* [Paper]()
|
|
|
25 |
* [GitHub with training scripts and data](https://github.com/s-nlp/multilingual-transformer-detoxification)
|
26 |
|
27 |
## Model Information
|
|
|
48 |
}
|
49 |
|
50 |
def detoxify(text, lang, model, tokenizer):
|
51 |
+
encodings = tokenizer(LANG_PROMPTS[lang] + text, return_tensors='pt').to(model.device)
|
52 |
|
53 |
outputs = model.generate(**encodings.to(model.device),
|
54 |
max_length=128,
|