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
File size: 1,878 Bytes
8d47318 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | 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
@classmethod
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')
|