Text Generation
MLX
Safetensors
English
gpt2
lottery
time-series
transformer
apple-silicon
causal-lm
idaho-pick3
conversational
Instructions to use curia007/pick3_llm_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use curia007/pick3_llm_model with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("curia007/pick3_llm_model") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use curia007/pick3_llm_model with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "curia007/pick3_llm_model"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "curia007/pick3_llm_model" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "curia007/pick3_llm_model", "messages": [ {"role": "user", "content": "Hello"} ] }' - Atomic Chat
Upload Idaho Pick 3 Transformer checkpoint and artifacts
Browse files- model.safetensors +1 -1
- pick3_hf_model.py +12 -0
- tokenizer_config.json +1 -0
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 640720
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0f11176104e85f66ccd8b8481fff0308f7ec850d0fbd141ea22e8ddccb80ae77
|
| 3 |
size 640720
|
pick3_hf_model.py
CHANGED
|
@@ -474,6 +474,17 @@ model.eval()
|
|
| 474 |
"transformers_version": config.transformers_version,
|
| 475 |
}
|
| 476 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 477 |
@classmethod
|
| 478 |
def get_fast_tokenizer_dict(cls) -> Dict[str, Any]:
|
| 479 |
"""Returns the serialized Hugging Face Tokenizers fast tokenizer dictionary."""
|
|
@@ -558,6 +569,7 @@ model.eval()
|
|
| 558 |
"unk_token": "[UNK]",
|
| 559 |
"model_max_length": max_len,
|
| 560 |
"clean_up_tokenization_spaces": False,
|
|
|
|
| 561 |
"added_tokens_decoder": {
|
| 562 |
"10": {"content": "<PAD>", "lstrip": False, "normalized": False, "rstrip": False, "single_word": False, "special": True},
|
| 563 |
"11": {"content": "<BOS>", "lstrip": False, "normalized": False, "rstrip": False, "single_word": False, "special": True},
|
|
|
|
| 474 |
"transformers_version": config.transformers_version,
|
| 475 |
}
|
| 476 |
|
| 477 |
+
DEFAULT_CHAT_TEMPLATE: str = (
|
| 478 |
+
"{% for message in messages %}"
|
| 479 |
+
"{% if loop.first and messages[0]['role'] != 'system' %}{{ '<BOS>' }}{% endif %}"
|
| 480 |
+
"{% if message['role'] == 'system' %}{{ '<BOS>' + message['content'].strip() + ' ' }}"
|
| 481 |
+
"{% elif message['role'] == 'user' %}{% if not loop.first and messages[loop.index0 - 1]['role'] == 'assistant' %}{{ ' ' }}{% endif %}{{ message['content'].strip() + ' <PRED>' }}"
|
| 482 |
+
"{% elif message['role'] == 'assistant' %}{{ ' ' + message['content'].strip() + ' <EOS>' }}"
|
| 483 |
+
"{% endif %}"
|
| 484 |
+
"{% endfor %}"
|
| 485 |
+
"{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}{{ ' ' }}{% endif %}"
|
| 486 |
+
)
|
| 487 |
+
|
| 488 |
@classmethod
|
| 489 |
def get_fast_tokenizer_dict(cls) -> Dict[str, Any]:
|
| 490 |
"""Returns the serialized Hugging Face Tokenizers fast tokenizer dictionary."""
|
|
|
|
| 569 |
"unk_token": "[UNK]",
|
| 570 |
"model_max_length": max_len,
|
| 571 |
"clean_up_tokenization_spaces": False,
|
| 572 |
+
"chat_template": cls.DEFAULT_CHAT_TEMPLATE,
|
| 573 |
"added_tokens_decoder": {
|
| 574 |
"10": {"content": "<PAD>", "lstrip": False, "normalized": False, "rstrip": False, "single_word": False, "special": True},
|
| 575 |
"11": {"content": "<BOS>", "lstrip": False, "normalized": False, "rstrip": False, "single_word": False, "special": True},
|
tokenizer_config.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
| 8 |
"unk_token": "[UNK]",
|
| 9 |
"model_max_length": 128,
|
| 10 |
"clean_up_tokenization_spaces": false,
|
|
|
|
| 11 |
"added_tokens_decoder": {
|
| 12 |
"10": {
|
| 13 |
"content": "<PAD>",
|
|
|
|
| 8 |
"unk_token": "[UNK]",
|
| 9 |
"model_max_length": 128,
|
| 10 |
"clean_up_tokenization_spaces": false,
|
| 11 |
+
"chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<BOS>' }}{% endif %}{% if message['role'] == 'system' %}{{ '<BOS>' + message['content'].strip() + ' ' }}{% elif message['role'] == 'user' %}{% if not loop.first and messages[loop.index0 - 1]['role'] == 'assistant' %}{{ ' ' }}{% endif %}{{ message['content'].strip() + ' <PRED>' }}{% elif message['role'] == 'assistant' %}{{ ' ' + message['content'].strip() + ' <EOS>' }}{% endif %}{% endfor %}{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}{{ ' ' }}{% endif %}",
|
| 12 |
"added_tokens_decoder": {
|
| 13 |
"10": {
|
| 14 |
"content": "<PAD>",
|