Downloads · 30 days
18
10% of all-time downloads
nickoo004/gpt2_karakalpak
gpt2_karakalpak is a text generation model from nickoo004. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
This is a GPT-2 (Generative Pre-trained Transformer 2) model, fine-tuned specifically for the Karakalpak language. The model is designed to generate coherent and contextually relevant text in Karakalpak, and capable o…
Downloads · 30 days
18
10% of all-time downloads
All-time downloads
189
Public
Parameters
124M
498 MB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors498 MB · 99%
From the Hugging Face model README
This is a GPT-2 (Generative Pre-trained Transformer 2) model, fine-tuned specifically for the Karakalpak language. The model is designed to generate coherent and contextually relevant text in Karakalpak, and capable of basic conversational responses based on the training data.
The model was fine-tuned on a custom dataset combining:
Data Preparation:
<|startoftext|>, <|endoftext|>) were used to delineate conversational turns in the dialogue data, allowing the model to learn conversational structure.gpt2 (from Hugging Face Transformers)Trainer APIAfter fine-tuning, the model achieved the following performance on the training dataset:
You can use this model with the transformers library in Python for text generation:
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "nickoo004/gpt2_karakalpak"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
device = 0 if torch.cuda.is_available() else -1
karakalpak_generator = pipeline('text-generation', model=model, tokenizer=tokenizer, device=device)
prompt_text = "Nókis qalası"
generated_text = karakalpak_generator(prompt_text, max_new_tokens=50, num_return_sequences=1)[0]['generated_text']
print(f"Generated text: {generated_text}")
dialog_prompt = "<|startoftext|>Ayta alasiz ba, sizdi kim jaratqan?<|sep|>"
generated_dialog = karakalpak_generator(dialog_prompt, max_new_tokens=100, num_return_sequences=1, pad_token_id=tokenizer.eos_token_id)[0]['generated_text']
if '<|endoftext|>' in generated_dialog:
generated_dialog = generated_dialog.split('<|endoftext|>')[0]
print(f"Generated dialogue: {generated_dialog}")