Downloads · 30 days
24
23% of all-time downloads
Naman0807/gujarati-lm
gujarati-lm is a text generation model from Naman0807. Use it when you need the model to write or continue text. The card lists the license as mit.
This is a compact Gujarati language model based on the GPT-2 architecture. It has been trained from scratch on a dataset of Gujarati headlines to demonstrate language modeling capabilities in low-resource settings.
Downloads · 30 days
24
23% of all-time downloads
All-time downloads
104
Public
Parameters
51.8M
207 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors207 MB · 99%
From the Hugging Face model README
This is a compact Gujarati language model based on the GPT-2 architecture. It has been trained from scratch on a dataset of Gujarati headlines to demonstrate language modeling capabilities in low-resource settings.
This model is intended for:
Note: Due to the small model size and limited training data (headlines), the generated text may not always be coherent for long paragraphs.
You can use this model directly with the Hugging Face pipeline or AutoModel classes.
from transformers import pipeline
generator = pipeline("text-generation", model="Naman0807/gujarati-lm")
prompt = "સરકાર"
output = generator(prompt, max_length=50, num_return_sequences=1)
print(output[0]['generated_text'])
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Naman0807/gujarati-lm")
model = AutoModelForCausalLM.from_pretrained("Naman0807/gujarati-lm")
input_text = "ગુજરાત રાજ્ય"
input_ids = tokenizer.encode(input_text, return_tensors="pt")
output = model.generate(input_ids, max_length=50, num_return_sequences=1)
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_text)
The model was trained on a dataset of Gujarati news headlines.
train.csv, valid.csv)GPT2Config(
vocab_size=64000,
n_positions=256,
n_ctx=256,
n_embd=512,
n_layer=6,
n_head=8
)