Instructions to use jed351/bart-zh-hk-wiki with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jed351/bart-zh-hk-wiki with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="jed351/bart-zh-hk-wiki")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("jed351/bart-zh-hk-wiki") model = AutoModelForSeq2SeqLM.from_pretrained("jed351/bart-zh-hk-wiki") - Notebooks
- Google Colab
- Kaggle
bart-base-cantonese
This is the Cantonese model of BART base. It is based on another model created by: https://huggingface.co/Ayaka/bart-base-cantonese
Usage
from transformers import BertTokenizer, BartForConditionalGeneration, Text2TextGenerationPipeline
tokenizer = BertTokenizer.from_pretrained('jed351/bart-zh-hk-wiki')
model = BartForConditionalGeneration.from_pretrained('jed351/bart-zh-hk-wiki')
text2text_generator = Text2TextGenerationPipeline(model, tokenizer)
output = text2text_generator('聽日就要返香港,我激動到[MASK]唔着', max_length=50, do_sample=False)
print(output[0]['generated_text'].replace(' ', ''))
Note: Please use the BertTokenizer for the model vocabulary. DO NOT use the original BartTokenizer.
- Downloads last month
- 9