Text Generation
Transformers
Safetensors
English
qwen3_5_text
toronto
slang
multicultural-toronto-english
persona
chat
lora
qwen3.5
conversational
Instructions to use devon7y/Toronto-Mans-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use devon7y/Toronto-Mans-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="devon7y/Toronto-Mans-9B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("devon7y/Toronto-Mans-9B") model = AutoModelForCausalLM.from_pretrained("devon7y/Toronto-Mans-9B", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use devon7y/Toronto-Mans-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "devon7y/Toronto-Mans-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "devon7y/Toronto-Mans-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/devon7y/Toronto-Mans-9B
- SGLang
How to use devon7y/Toronto-Mans-9B 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 "devon7y/Toronto-Mans-9B" \ --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": "devon7y/Toronto-Mans-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "devon7y/Toronto-Mans-9B" \ --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": "devon7y/Toronto-Mans-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use devon7y/Toronto-Mans-9B with Docker Model Runner:
docker model run hf.co/devon7y/Toronto-Mans-9B
| """Serving-time post-processing for the frozen persona (35B main_v5 + prompt v0). | |
| Rule from the owner: on every second reply, the crying emoji, which the model uses as sentence punctuation, becomes a period. | |
| Usage: from postprocess import Postprocessor; pp = Postprocessor(); text = pp(text)""" | |
| import re | |
| EMO = 'π' | |
| def emoji_to_period(text: str) -> str: | |
| # π followed by end/newline/space+capital/space+lowercase: it closes a sentence -> "." | |
| # π directly before existing punctuation: just drop it. Preceding space is absorbed. | |
| text = re.sub(r'\s*π+(?=\s*[.!?,])', '', text) # "...money π." -> "...money." | |
| text = re.sub(r'\s*π+(?=\s*$|\s*\n)', '.', text) # end of text or line -> "." | |
| text = re.sub(r'\s*π+\s+(?=\S)', '. ', text) # mid-text -> ". next" | |
| text = re.sub(r'\.\s*\.', '.', text) # collapse doubles | |
| # capitalize the word after a period we inserted, when the model wrote it lowercase mid-line | |
| return re.sub(r'(\. )([a-z])', lambda m: m.group(1) + m.group(2).upper(), text) | |
| class Postprocessor: | |
| def __init__(self): self.n = 0 | |
| def __call__(self, text: str) -> str: | |
| self.n += 1 | |
| return emoji_to_period(text) if self.n % 2 == 0 else text | |
| if __name__ == '__main__': | |
| import json, sys | |
| rows = [json.loads(l) for l in open(sys.argv[1])] | |
| ctx = [r['reply'] for r in rows if r['kind'] == 'ctx' and r.get('expect') == 'slang_on' and EMO in r['reply']] | |
| for t in ctx[:4]: print('BEFORE:', t.strip()[:230], '\nAFTER: ', emoji_to_period(t).strip()[:230], '\n') | |