Instructions to use dynamofl/dynamo-8B-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dynamofl/dynamo-8B-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dynamofl/dynamo-8B-v0.1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dynamofl/dynamo-8B-v0.1") model = AutoModelForCausalLM.from_pretrained("dynamofl/dynamo-8B-v0.1") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use dynamofl/dynamo-8B-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dynamofl/dynamo-8B-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dynamofl/dynamo-8B-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dynamofl/dynamo-8B-v0.1
- SGLang
How to use dynamofl/dynamo-8B-v0.1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "dynamofl/dynamo-8B-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dynamofl/dynamo-8B-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
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 "dynamofl/dynamo-8B-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dynamofl/dynamo-8B-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dynamofl/dynamo-8B-v0.1 with Docker Model Runner:
docker model run hf.co/dynamofl/dynamo-8B-v0.1
Model Vocab Size and Tokenizer Vocab Size NOT SAME. It is problem For Training ?
WHICH ONE IS TRUE ? HOW TO SOLVE THIS PROBLEM .
model.config.vocab = 157824
tokenizer.vocab_size = 157797
We solve this problem. This example:
"""
if model.config.vocab != tokenizer.vocab_size:
model.resize_token_embeddings(len(tokenizer))
"""
But this solution, during training this cause problem ? And Reduce Embedding vocab size O
Hey GokhanAI!
You don’t need to resize the embedding matrix. It’s fine if the model embedding matrix is larger in length than the config vocab size. We pad the model embedding matrix to a multiple of 64 to take advantage of the ampere GPU’s. Hence the reason, model.config.vocab > tokenizer.vocab_size
Please do let me know if that works, otherwise I can provide a short snippet on how to further fine-tune the model for a downstream task.
Please do let me know if that works, otherwise I can provide a short snippet on how to further fine-tune the model for a downstream task.
Thank you for your return.
I want to implement /huggingface/alignment-handbook sft and dpo structures. I want to make the dataset they suggested by making it suitable for Turkish. I aim to establish a chat structure. Do you think I can achieve success with this? I'm afraid I don't know how successful it will be in Turkish, but I would like to get your thoughts and advice.
Hey Gokhan! Yes, I believe it should be successful with Turkish. However, this solely depends on your dataset and the quality of it. One chat structure you could consider taking after is HuggingFaceH4/zephyr-7b-alpha.
That would look something like:
messages = [
{
"role": "system",
"content": "Sen arkadaş canlısı bir sohbet robotusun.",
},
{"role": "user", "content": "Adın ne senin??"},
]
Please do let me know if that works, otherwise I can provide a short snippet on how to further fine-tune the model for a downstream task.
Hello, /huggingface/alignment-handbook for training The results were not good at all. I also tried different SFT methods. But the result either produces no answers or produces complete meaningless sentences. I trained the data in Turkish format. How can you help with this? Do you have any SFT-DPO codes you recommend?