Instructions to use BangorAI/mistral-7b-cy-tokenizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BangorAI/mistral-7b-cy-tokenizer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BangorAI/mistral-7b-cy-tokenizer")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BangorAI/mistral-7b-cy-tokenizer") model = AutoModelForCausalLM.from_pretrained("BangorAI/mistral-7b-cy-tokenizer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BangorAI/mistral-7b-cy-tokenizer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BangorAI/mistral-7b-cy-tokenizer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BangorAI/mistral-7b-cy-tokenizer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BangorAI/mistral-7b-cy-tokenizer
- SGLang
How to use BangorAI/mistral-7b-cy-tokenizer 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 "BangorAI/mistral-7b-cy-tokenizer" \ --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": "BangorAI/mistral-7b-cy-tokenizer", "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 "BangorAI/mistral-7b-cy-tokenizer" \ --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": "BangorAI/mistral-7b-cy-tokenizer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BangorAI/mistral-7b-cy-tokenizer with Docker Model Runner:
docker model run hf.co/BangorAI/mistral-7b-cy-tokenizer
Mistral gyda ychwanegiad Tocynnydd Cymreig
Mae model Mistral yn cynnwys 32,000 tocynn yn ei eirfa.
Wrth amgodio brawddeg yn y gymraeg, mae'r tocynnau ar wasgar i'w gymharu hefo'r Saesneg:
Tocynnydd Mistral 32k
This is a tokenizer test
['▁This', '▁is', '▁a', '▁token', 'izer', '▁test']
Roedd y gath yn eistedd ar y llawr
['▁Ro', 'ed', 'd', '▁y', '▁g', 'ath', '▁y', 'n', '▁e', 'isted', 'd', '▁ar', '▁y', '▁ll', 'aw', 'r']
Tocynnydd Cymreig 16k
Wrth greu tocynnydd o'r newydd wedi ei hyfforddi ar ddata Cymreig, cawn gynrychiolaeth llawer tynach yn y Gymraeg. Mae'r Saesneg wedi gwaethygu, fodd bynnag.
This is a tokenizer test
['▁This', '▁is', '▁a', '▁to', 'ke', 'n', 'ize', 'r', '▁', 'test']
Roedd y gath yn eistedd ar y llawr
['▁Roedd', '▁y', '▁gath', '▁yn', '▁eistedd', '▁ar', '▁y', '▁llawr']
Tocynnydd Gyfunol
Wrth gyfuno tocynnydd Mistral gyda ein tocynnydd newydd Cymraeg, cawn un sydd yn medru mynegi tocynnau yn y ddwy iaith yn effeithiol:
This is a tokenizer test
['▁This', '▁is', '▁a', '▁token', 'izer', '▁test']
Roedd y gath yn eistedd ar y llawr
['▁Roedd', '▁y', '▁gath', '▁yn', '▁', 'eis', 't', 'edd', '▁ar', '▁y', '▁llawr']
Mae set o docynnau yn cael eu rhannu rhwng y ddwy iaith, sydd yn rhoi cyfanswm o 44,955 tocyn yn y fersiwn yma.
Mae'r model Mistral wedi ei ehangu ar ei gyfer - ond dylir gofio fod angen hyfforddi'r model gryn dipyn er mwyn gysylltu ystyr y tocynnau newydd hefo'r rhai sydd yn y model yn barod.
- Downloads last month
- 6