Downloads · 30 days
13
33% of all-time downloads
RichardErkhov/ytu-ce-cosmos_-_turkish-gpt2-large-750m-instruct-v0.1-4bits
ytu-ce-cosmos_-_turkish-gpt2-large-750m-instruct-v0.1-4bits is a machine learning model from RichardErkhov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
13
33% of all-time downloads
All-time downloads
40
Public
Parameters
785M
531 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors531 MB · 99%
How the weights are stored.
U8708M · 90%
From the Hugging Face model README
Quantization made by Richard Erkhov.
turkish-gpt2-large-750m-instruct-v0.1 - bnb 4bits
widget:
license: mit language:
tags:
Derived from ytu-ce-cosmos/turkish-gpt2-large, this model is a Turkish Language Model (LLM) finetuned with a dataset consisting of 35K instructions. Due to the diverse nature of the training data, which includes websites, books, and other text sources, this model can exhibit biases and generate wrong answers. Users should be aware of these biases and use the model responsibly.
import torch
from transformers import AutoTokenizer, GPT2LMHeadModel
from transformers import pipeline
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
device_id = 0 if torch.cuda.is_available() else -1
model = GPT2LMHeadModel.from_pretrained("ytu-ce-cosmos/turkish-gpt2-large-750m-instruct-v0.1").to(device)
tokenizer = AutoTokenizer.from_pretrained("ytu-ce-cosmos/turkish-gpt2-large-750m-instruct-v0.1")
text_generator = pipeline('text-generation', model=model, tokenizer=tokenizer, device=device_id, max_new_tokens=256)
def get_model_response(instruction):
instruction_prompt = f"### Kullanıcı:\n{instruction}\n### Asistan:\n"
result = text_generator(instruction_prompt)
generated_response = result[0]['generated_text']
return generated_response[len(instruction_prompt):]
model_response = get_model_response("Evde egzersiz yapmanın avantajlarını açıkla.")
print(model_response)
"""
Evde egzersiz yapmak, gelişmiş fiziksel ve zihinsel sağlık için harika bir yoldur. Düzenli egzersizin, artan enerji seviyeleri, gelişmiş kas gücü ve esnekliği, gelişmiş uyku kalitesi ve daha iyi genel esenlik dahil olmak üzere birçok faydası vardır. Evde egzersiz yapmak ayrıca stresi azaltmaya, kas gücünü artırmaya ve genel sağlığı iyileştirmeye yardımcı olabilir.
"""
To use the chat template:
chat_generator = pipeline("conversational", model=model, tokenizer=tokenizer, device=device_id, max_new_tokens=256)
messages = [
{"role": "user", "content": "Evde egzersiz yapmanın avantajlarını açıkla."}
]
chat_outputs = chat_generator(messages)
print(chat_outputs)
"""
Conversation id: 236ffc4a-2a36-4191-92fb-90d6753df1ae
user: Evde egzersiz yapmanın avantajlarını açıkla.
assistant: Evde egzersiz yapmak, gelişmiş fiziksel ve zihinsel sağlık için sayısız avantaj sunar. Düzenli egzersiz, stresi azaltmaya, kas gücünü artırmaya ve genel sağlığı iyileştirmeye yardımcı olabilir. Ayrıca, evde egzersiz yapmak, daha iyi uyku kalitesi, artan enerji seviyeleri ve gelişmiş bilişsel işlevler gibi daha iyi fiziksel ve zihinsel sağlık sonuçları sağlayabilir. Evde egzersiz yapmak ayrıca, gelişmiş esneklik, denge ve koordinasyon, gelişmiş kalp sağlığı ve gelişmiş kemik sağlığı dahil olmak üzere gelişmiş fiziksel ve zihinsel sağlık yararları sağlayabilir.
"""
We've meticulously fine-tuned this model with a 35,000-instruction Turkish dataset to enhance its precision and adaptability.
By employing LoRA (Low-Rank Adaptation), we have successfully propelled this model to the pinnacle of its performance capabilities.
LoRA Config:
In addition to monitoring loss, we successfully integrated Rouge calculations into our system's evaluation metrics.
One of the innovative techniques we adopted involved employing a model to cleanse our data.
Other relevant information can be found in the paper.
ytu-ce-cosmos/turkish-gpt2-large@article{kesgin2024introducing,
title={Introducing cosmosGPT: Monolingual Training for Turkish Language Models},
author={Kesgin, H Toprak and Yuce, M Kaan and Dogan, Eren and Uzun, M Egemen and Uz, Atahan and Seyrek, H Emre and Zeer, Ahmed and Amasyali, M Fatih},
journal={arXiv preprint arXiv:2404.17336},
year={2024}
}
COSMOS AI Research Group, Yildiz Technical University Computer Engineering Department <br> https://cosmos.yildiz.edu.tr/ <br> [email protected]