Text Generation
Transformers
Safetensors
GGUF
Chinese
English
mixtral
gomoku
ollama
Mixture of Experts
conversational
text-generation-inference
Instructions to use l898974766/gomoku with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use l898974766/gomoku with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="l898974766/gomoku") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("l898974766/gomoku") model = AutoModelForCausalLM.from_pretrained("l898974766/gomoku", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use l898974766/gomoku 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 l898974766/gomoku:F32 # Run inference directly in the terminal: llama cli -hf l898974766/gomoku:F32
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf l898974766/gomoku:F32 # Run inference directly in the terminal: llama cli -hf l898974766/gomoku:F32
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf l898974766/gomoku:F32 # Run inference directly in the terminal: ./build/bin/llama cli -hf l898974766/gomoku:F32
Use Docker
docker model run hf.co/l898974766/gomoku:F32
- Llama new
- LM Studio
- Jan
- vLLM
How to use l898974766/gomoku with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "l898974766/gomoku" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "l898974766/gomoku", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/l898974766/gomoku:F32
- SGLang
How to use l898974766/gomoku 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 "l898974766/gomoku" \ --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": "l898974766/gomoku", "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 "l898974766/gomoku" \ --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": "l898974766/gomoku", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use l898974766/gomoku with Ollama:
ollama run hf.co/l898974766/gomoku:F32
- Unsloth Desktop
- Docker Model Runner
How to use l898974766/gomoku with Docker Model Runner:
docker model run hf.co/l898974766/gomoku:F32
- Lemonade
How to use l898974766/gomoku with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull l898974766/gomoku:F32
Run and chat with the model
lemonade run user.gomoku-F32
List all available models
lemonade list
- Atomic Chat
Download window_protocol.py from l898974766/gomoku: direct link, hf CLI and curl.
- Browser
- Download file 2.21 kB
-
https://huggingface.co/l898974766/gomoku/resolve/main/window_protocol.py
- Command line
-
hf download hf://l898974766/gomoku/window_protocol.py
-
curl -L -o window_protocol.py https://huggingface.co/l898974766/gomoku/resolve/main/window_protocol.py
2.21 kB
| """Lossless raw directional board context; no tactical scoring or move selection.""" | |
| import re | |
| CONTEXT_LENGTH = 2048 | |
| SYSTEM = ('Play 15x15 Gomoku. X is you, O is the opponent, . is empty, # is outside. ' | |
| 'Each empty coordinate has four 9-cell raw lines: horizontal, vertical, ' | |
| 'diagonal down and diagonal up. Occupied cells are <coordinate:X/O>. ' | |
| 'Read the board and reply with one empty coordinate only.') | |
| DIRECTIONS = [(1, 0), (0, 1), (1, 1), (1, -1)] | |
| def validate_board(board): | |
| if not isinstance(board, list) or len(board) != 225 or any(type(v) is not int or v not in (0, 1, 2) for v in board): | |
| raise ValueError('board must contain 225 integers in {0, 1, 2}') | |
| def coordinate(move): | |
| if type(move) is not int or not 0 <= move < 225: | |
| raise ValueError('invalid move index') | |
| return f'{chr(65+move % 15)}{move//15+1}' | |
| def lines_at(board, move): | |
| x, y = move % 15, move//15 | |
| return [''.join('.XO'[board[(y+k*dy)*15+x+k*dx]] if 0 <= x+k*dx < 15 and 0 <= y+k*dy < 15 else '#' | |
| for k in range(-4, 5)) for dx, dy in DIRECTIONS] | |
| def records(board): | |
| validate_board(board) | |
| return [f'<{coordinate(m)}:{".XO"[v]}>' if v else coordinate(m)+''.join('<line:'+line+'>' for line in lines_at(board, m)) | |
| for m, v in enumerate(board)] | |
| def board_text(board): | |
| cells = records(board) | |
| return '\n'.join(''.join(cells[y*15:(y+1)*15]) for y in range(15))+'\nYour move:' | |
| def messages(board): | |
| return [{'role': 'system', 'content': SYSTEM}, {'role': 'user', 'content': board_text(board)}] | |
| def parse_move(text, board): | |
| validate_board(board) | |
| match = re.fullmatch(r'([A-O])(1[0-5]|[1-9])', text.strip(), flags=re.IGNORECASE) | |
| if not match: | |
| raise ValueError('model did not generate exactly one coordinate') | |
| move = (int(match[2])-1)*15+ord(match[1].upper())-65 | |
| if board[move]: | |
| raise ValueError('model selected an occupied cell') | |
| return move | |
| def relative(board, player): | |
| validate_board(board) | |
| if type(player) is not int or player not in (1, 2): | |
| raise ValueError('player must be 1 or 2') | |
| return [0 if v == 0 else 1 if v == player else 2 for v in board] | |