TR Models
Collection
5 items • Updated • 2
How to use umarigan/Trendyol-LLM-7b-chat-v0.1-DPO with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="umarigan/Trendyol-LLM-7b-chat-v0.1-DPO")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("umarigan/Trendyol-LLM-7b-chat-v0.1-DPO")
model = AutoModelForCausalLM.from_pretrained("umarigan/Trendyol-LLM-7b-chat-v0.1-DPO")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use umarigan/Trendyol-LLM-7b-chat-v0.1-DPO with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "umarigan/Trendyol-LLM-7b-chat-v0.1-DPO"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "umarigan/Trendyol-LLM-7b-chat-v0.1-DPO",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/umarigan/Trendyol-LLM-7b-chat-v0.1-DPO
How to use umarigan/Trendyol-LLM-7b-chat-v0.1-DPO with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "umarigan/Trendyol-LLM-7b-chat-v0.1-DPO" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "umarigan/Trendyol-LLM-7b-chat-v0.1-DPO",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "umarigan/Trendyol-LLM-7b-chat-v0.1-DPO" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "umarigan/Trendyol-LLM-7b-chat-v0.1-DPO",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use umarigan/Trendyol-LLM-7b-chat-v0.1-DPO with Docker Model Runner:
docker model run hf.co/umarigan/Trendyol-LLM-7b-chat-v0.1-DPO
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="umarigan/Trendyol-LLM-7b-chat-v0.1-DPO")
# Generate text
sequences = pipe(
"büyük dil modellerinin finans alanındaki kullanımları nelerdir",
do_sample=True,
temperature=0.7,
top_p=0.9,
num_return_sequences=1,
max_length=200,
)
print(sequences[0]['generated_text'])
Question: büyük dil modellerinin finans alanındaki kullanımları nelerdir?
Answer: Çok büyük dil modelleri, özellikle de Transformer gibi, karmaşık dil görevlerinin üstesinden gelmek için tasarlanmışlardır. Bu, finansal piyasalardaki veri işleme, fiyat tahmini ve analizleri, finansal haberler ve raporlama gibi süreçleri içerir. Ayrıca, büyük dil modelleri, doğal dil işleme, metin sınıflandırma ve soru cevaplama gibi görevlerin yanı sıra, müşteri hizmetleri gibi insan etkileşimi gerektiren finansal hizmetlerde de kullanılmaktadır.
This model trained on falcon instruction dataset that translated to Turkis language Dataset: https://huggingface.co/datasets/umarigan/falcon_feedback_instraction_Turkish
Some training arguments are as follow:
max_prompt_length=1024,
max_length=1536,
per_device_train_batch_size=4,
gradient_accumulation_steps=4,
gradient_checkpointing=True,
learning_rate=5e-5,
lr_scheduler_type="cosine",
max_steps=200,
save_strategy="no",
logging_steps=1,
output_dir=new_model,
optim="paged_adamw_32bit",
warmup_steps=100,
fp16=True,
wandb results: https://api.wandb.ai/links/umar-i-gan/0hnrvrdq