Downloads · 30 days
135
13% of all-time downloads
jed351/gpt2_base_zh-hk-lihkg
gpt2_base_zh-hk-lihkg is a text generation model from jed351. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as openrail.
Please be aware that the training data might contain inappropriate content. This model is intended for research purposes only.
Downloads · 30 days
135
13% of all-time downloads
All-time downloads
1.1K
Public
Repo size
20.2 GB
Likes
4
Public
Click a slice to open those files.
.bin5.4 GB · 100%
From the Hugging Face model README
Please be aware that the training data might contain inappropriate content. This model is intended for research purposes only.
The base model can be found here, which was obtained by patching a GPT2 Chinese model and its tokenizer with Cantonese characters. Refer to the base model for info on the patching process.
The training data was obtained from scrapping an online forum in Hong Kong called LIHKG. The tool can be found here. Please also check out the Bart model created by her.
The model was trained on ~10GB of data scrapped from LIHKG. It might contain violent and rude languages so as the text generated by the model. Please do not use it for anything other than research or entertainment.
The comments on LIHKG also tend to be very short. Thus the model cannot generate anything more than a line. In a lot of occasions might not even generate new tokens.
Please refer to the script provided by Huggingface.
The model was trained for 7 epochs on 1 NVIDIA Quadro RTX6000 at the Research Computing Services of Imperial College London.
from transformers import AutoTokenizer
from transformers import TextGenerationPipeline, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("jed351/gpt2_base_zh-hk-lihkg")
model = AutoModelForCausalLM.from_pretrained("jed351/gpt2_base_zh-hk-lihkg")
# try messing around with the parameters
generator = TextGenerationPipeline(model, tokenizer,
max_new_tokens=200,
no_repeat_ngram_size=3) #, device=0) #if you have a GPU
input_string = "your input"
output = generator(input_string)
string = output[0]['generated_text'].replace(' ', '')
print(string)