flax-community / gpt-2-tamil

huggingface.co
Total runs: 25
24-hour runs: 0
7-day runs: 5
30-day runs: -31
Model's Last Updated: July 19 2021
text-generation

Introduction of gpt-2-tamil

Model Details of gpt-2-tamil

GPT2-Tamil

This repository is created as part of the Flax/Jax community week by Huggingface. The aim of this project is to pretrain a language model using GPT-2 specifically for Tamil language.

Setup:

To setup the project, run the following command,

pip install -r requirements.txt
Model:

Pretrained model on Tamil language using a causal language modeling (CLM) objective.

Dataset Used:

The GTP-2 model is trained on oscar dataset - ta

Intended uses & limitations:

You can use the raw model for next sentence prediction, but it's mostly intended to be fine-tuned on a downstream task. See the model hub to look for fine-tuned versions on a task that interests you.

How to pretrain the model:

To perform training, do the following steps,

  • Export the model directory (where you want to store the model artifacts like config, tokenizer, etc.)
>>> export MODEL_DIR=<model_dir>
  • Create the config.json by running the following command,
>>> python src/create_config.py
  • Create the tokenizer by running the following command,
>>> python src/train_tokenizer.py
  • Once the config and tokenizer is created, run the following script to start training the flax model
>>> python scripts/train_gpt2-oscar-tamil.sh
How to use:

To perform language generation using the model, pipeline can be used directly.

  • First convert the flax model to pytorch using the following command,
python src/convert_flax_to_pytorch.py
  • Use the following snippet to perform language generation,
 >>> from transformers import AutoTokenizer, AutoModelWithLMHead, pipeline
 >>> model_name = 'abinayam/gpt-2-tamil'
 >>> model = AutoModelWithLMHead.from_pretrained(model_name)
 >>> tokenizer = AutoTokenizer.from_pretrained(model_name)
 >>> set_seed(42)
 >>> input_text = "ஒரு ஊரிலே ஒரு காக்கைக்கு"
 >>> max_len = 300
 >>> no_seq = 5
 >>> generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
 >>> sequence = generator(input_text, max_length=max_len, num_return_sequences=no_seq)

Runs of flax-community gpt-2-tamil on huggingface.co

25
Total runs
0
24-hour runs
1
3-day runs
5
7-day runs
-31
30-day runs

More Information About gpt-2-tamil huggingface.co Model

gpt-2-tamil huggingface.co

gpt-2-tamil huggingface.co is an AI model on huggingface.co that provides gpt-2-tamil's model effect (), which can be used instantly with this flax-community gpt-2-tamil model. huggingface.co supports a free trial of the gpt-2-tamil model, and also provides paid use of the gpt-2-tamil. Support call gpt-2-tamil model through api, including Node.js, Python, http.

flax-community gpt-2-tamil online free

gpt-2-tamil huggingface.co is an online trial and call api platform, which integrates gpt-2-tamil's modeling effects, including api services, and provides a free online trial of gpt-2-tamil, you can try gpt-2-tamil online for free by clicking the link below.

flax-community gpt-2-tamil online free url in huggingface.co:

https://huggingface.co/flax-community/gpt-2-tamil

gpt-2-tamil install

gpt-2-tamil is an open source model from GitHub that offers a free installation service, and any user can find gpt-2-tamil on GitHub to install. At the same time, huggingface.co provides the effect of gpt-2-tamil install, users can directly use gpt-2-tamil installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

gpt-2-tamil install url in huggingface.co:

https://huggingface.co/flax-community/gpt-2-tamil

Url of gpt-2-tamil

Provider of gpt-2-tamil huggingface.co

flax-community
ORGANIZATIONS

Other API from flax-community