

# gpt2-shikoto

This model was trained on a dataset I obtained from an online novel site. 
**Please be aware that the stories (training data) might contain inappropriate content. This model is intended for research purposes only.**



The base model can be found [here](https://huggingface.co/jed351/gpt2-base-zh-hk), which was obtained by 
patching a [GPT2 Chinese model](https://huggingface.co/ckiplab/gpt2-base-chinese) and its tokenizer with Cantonese characters.
Refer to the base model for info on the patching process.

Besides language modeling, another aim of this experiment was to test the accelerate library by offloading certain workloads to CPU as well as finding the optimal training iterations.

The perplexity of this model is 16.12 after 400,000 steps. Comparing to the previous [attempt](https://huggingface.co/jed351/gpt2_tiny_zh-hk-shikoto) 27.02 after 400,000 steps. 
It took around the same time duration to train this model but I only used 1 GPU here.


## Training procedure

Please refer to the [script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling) 
provided by Huggingface. 


The model was trained for 400,000 steps on 1 NVIDIA Quadro RTX6000 for around 30 hours at the Research Computing Services of Imperial College London. 




### How to use it?
```
from transformers import AutoTokenizer
from transformers import TextGenerationPipeline, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("jed351/gpt2-base-zh-hk")
model = AutoModelForCausalLM.from_pretrained("jed351/gpt2_base_zh-hk-shikoto")
# 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)
```

### Framework versions

- Transformers 4.26.0.dev0
- Pytorch 1.13.1
- Datasets 2.8.0
- Tokenizers 0.13.2
{"license": "openrail", "tags": ["generated_from_trainer"], "datasets": ["jed351/shikoto_zh_hk"], "metrics": ["accuracy"], "model-index": [{"name": "gpt2-shikoto", "results": [{"task": {"type": "text-generation", "name": "Causal Language Modeling"}, "dataset": {"name": "jed351/shikoto_zh_hk", "type": "jed351/shikoto_zh_hk"}, "metrics": [{"type": "loss", "value": 3.0956006050109863, "name": "Loss"}]}]}]}
transformers pytorch gpt2 text-generation generated_from_trainer dataset:jed351/shikoto_zh_hk license:openrail model-index autotrain_compatible endpoints_compatible text-generation-inference region:us
TAGS
#transformers #pytorch #gpt2 #text-generation #generated_from_trainer #dataset-jed351/shikoto_zh_hk #license-openrail #model-index #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 



# gpt2-shikoto

This model was trained on a dataset I obtained from an online novel site. 
Please be aware that the stories (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.

Besides language modeling, another aim of this experiment was to test the accelerate library by offloading certain workloads to CPU as well as finding the optimal training iterations.

The perplexity of this model is 16.12 after 400,000 steps. Comparing to the previous attempt 27.02 after 400,000 steps. 
It took around the same time duration to train this model but I only used 1 GPU here.


## Training procedure

Please refer to the script 
provided by Huggingface. 


The model was trained for 400,000 steps on 1 NVIDIA Quadro RTX6000 for around 30 hours at the Research Computing Services of Imperial College London. 




### How to use it?


### Framework versions

- Transformers 4.26.0.dev0
- Pytorch 1.13.1
- Datasets 2.8.0
- Tokenizers 0.13.2
# gpt2-shikoto

This model was trained on a dataset I obtained from an online novel site. 
Please be aware that the stories (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.

Besides language modeling, another aim of this experiment was to test the accelerate library by offloading certain workloads to CPU as well as finding the optimal training iterations.

The perplexity of this model is 16.12 after 400,000 steps. Comparing to the previous attempt 27.02 after 400,000 steps. 
It took around the same time duration to train this model but I only used 1 GPU here. ## Training procedure

Please refer to the script 
provided by Huggingface. 


The model was trained for 400,000 steps on 1 NVIDIA Quadro RTX6000 for around 30 hours at the Research Computing Services of Imperial College London. ### How to use it? ### Framework versions

- Transformers 4.26.0.dev0
- Pytorch 1.13.1
- Datasets 2.8.0
- Tokenizers 0.13.2
TAGS
#transformers #pytorch #gpt2 #text-generation #generated_from_trainer #dataset-jed351/shikoto_zh_hk #license-openrail #model-index #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
 # gpt2-shikoto

This model was trained on a dataset I obtained from an online novel site. 
Please be aware that the stories (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.

Besides language modeling, another aim of this experiment was to test the accelerate library by offloading certain workloads to CPU as well as finding the optimal training iterations.

The perplexity of this model is 16.12 after 400,000 steps. Comparing to the previous attempt 27.02 after 400,000 steps. 
It took around the same time duration to train this model but I only used 1 GPU here. ## Training procedure

Please refer to the script 
provided by Huggingface. 


The model was trained for 400,000 steps on 1 NVIDIA Quadro RTX6000 for around 30 hours at the Research Computing Services of Imperial College London. ### How to use it? ### Framework versions

- Transformers 4.26.0.dev0
- Pytorch 1.13.1
- Datasets 2.8.0
- Tokenizers 0.13.2
TAGS
#transformers #pytorch #gpt2 #text-generation #generated_from_trainer #dataset-jed351/shikoto_zh_hk #license-openrail #model-index #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
# gpt2-shikoto

This model was trained on a dataset I obtained from an online novel site. 
Please be aware that the stories (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.

Besides language modeling, another aim of this experiment was to test the accelerate library by offloading certain workloads to CPU as well as finding the optimal training iterations.

The perplexity of this model is 16.12 after 400,000 steps. Comparing to the previous attempt 27.02 after 400,000 steps. 
It took around the same time duration to train this model but I only used 1 GPU here.## Training procedure

Please refer to the script 
provided by Huggingface. 


The model was trained for 400,000 steps on 1 NVIDIA Quadro RTX6000 for around 30 hours at the Research Computing Services of Imperial College London.### How to use it?### Framework versions

- Transformers 4.26.0.dev0
- Pytorch 1.13.1
- Datasets 2.8.0
- Tokenizers 0.13.2