Text Generation
PyTorch
GGUF
Japanese
English
japanese
little-language-model
tiny-language-model
edge-ai
embedded-ai
ex-word
llama-cpp
lm-studio
custom-code
conversational
Instructions to use ToTo-40417/EXLLM-ONI5M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ToTo-40417/EXLLM-ONI5M with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ToTo-40417/EXLLM-ONI5M:F16 # Run inference directly in the terminal: llama cli -hf ToTo-40417/EXLLM-ONI5M:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ToTo-40417/EXLLM-ONI5M:F16 # Run inference directly in the terminal: llama cli -hf ToTo-40417/EXLLM-ONI5M:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf ToTo-40417/EXLLM-ONI5M:F16 # Run inference directly in the terminal: ./llama-cli -hf ToTo-40417/EXLLM-ONI5M:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf ToTo-40417/EXLLM-ONI5M:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf ToTo-40417/EXLLM-ONI5M:F16
Use Docker
docker model run hf.co/ToTo-40417/EXLLM-ONI5M:F16
- LM Studio
- Jan
- vLLM
How to use ToTo-40417/EXLLM-ONI5M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ToTo-40417/EXLLM-ONI5M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ToTo-40417/EXLLM-ONI5M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ToTo-40417/EXLLM-ONI5M:F16
- Ollama
How to use ToTo-40417/EXLLM-ONI5M with Ollama:
ollama run hf.co/ToTo-40417/EXLLM-ONI5M:F16
- Unsloth Desktop
- Docker Model Runner
How to use ToTo-40417/EXLLM-ONI5M with Docker Model Runner:
docker model run hf.co/ToTo-40417/EXLLM-ONI5M:F16
- Lemonade
How to use ToTo-40417/EXLLM-ONI5M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ToTo-40417/EXLLM-ONI5M:F16
Run and chat with the model
lemonade run user.EXLLM-ONI5M-F16
List all available models
lemonade list
- Atomic Chat
Download src/tokenizer.py from ToTo-40417/EXLLM-ONI5M: direct link, hf CLI and curl.
- Browser
- Download file 1.88 kB
-
https://huggingface.co/ToTo-40417/EXLLM-ONI5M/resolve/main/src/tokenizer.py
- Command line
-
hf download hf://ToTo-40417/EXLLM-ONI5M/src/tokenizer.py
-
curl -L -o tokenizer.py https://huggingface.co/ToTo-40417/EXLLM-ONI5M/resolve/main/src/tokenizer.py
1.88 kB
| import json, unicodedata | |
| from pathlib import Path | |
| BYTE_BASE=0; BYTE_COUNT=256 | |
| def normalize_text(s:str)->str: | |
| s=unicodedata.normalize('NFC',s) | |
| return ''.join((' ' if (ord(c)<32 and c not in '\n\t') else c) for c in s).strip() | |
| class HybridTokenizer: | |
| def __init__(self, chars): | |
| self.chars=list(chars); self.char_to_id={c:256+i for i,c in enumerate(self.chars)} | |
| s=256+len(self.chars); self.PAD=s; self.BOS=s+1; self.USER=s+2; self.ASSIST=s+3; self.EOS=s+4; self.vocab_size=s+5 | |
| def load(cls,path): return cls(json.loads(Path(path).read_text(encoding='utf-8'))['chars']) | |
| def encode_text(self,s): | |
| out=[] | |
| for c in normalize_text(s): | |
| if c in self.char_to_id: out.append(self.char_to_id[c]) | |
| else: out.extend(c.encode('utf-8','strict')) | |
| return out | |
| def encode_user(self,s): return [self.BOS,self.USER,*self.encode_text(s),self.ASSIST] | |
| def encode_example(self,prompt,answer,max_seq_len=128): | |
| p=self.encode_text(prompt); a=self.encode_text(answer) | |
| seq=[self.BOS,self.USER,*p,self.ASSIST,*a,self.EOS] | |
| if len(seq)>max_seq_len: | |
| excess=len(seq)-max_seq_len; p=p[min(excess,len(p)):] | |
| seq=[self.BOS,self.USER,*p,self.ASSIST,*a,self.EOS] | |
| if len(seq)>max_seq_len: | |
| a=a[:max(1,max_seq_len-(4+len(p)))] | |
| seq=[self.BOS,self.USER,*p,self.ASSIST,*a,self.EOS] | |
| return seq | |
| def token_bytes(self,tok): | |
| if 0<=tok<256: return bytes([tok]) | |
| i=tok-256 | |
| if 0<=i<len(self.chars): return self.chars[i].encode('utf-8') | |
| return b'' | |
| def decode(self,toks): | |
| b=bytearray() | |
| for t in toks: | |
| if t in (self.PAD,self.BOS,self.USER,self.ASSIST,self.EOS): continue | |
| b.extend(self.token_bytes(t)) | |
| return bytes(b).decode('utf-8','strict') | |