Instructions to use modularai/replit-code-1.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use modularai/replit-code-1.5 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="modularai/replit-code-1.5", filename="replit-code-v1_5-3b-bf16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use modularai/replit-code-1.5 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf modularai/replit-code-1.5:BF16 # Run inference directly in the terminal: llama-cli -hf modularai/replit-code-1.5:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf modularai/replit-code-1.5:BF16 # Run inference directly in the terminal: llama-cli -hf modularai/replit-code-1.5:BF16
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 modularai/replit-code-1.5:BF16 # Run inference directly in the terminal: ./llama-cli -hf modularai/replit-code-1.5:BF16
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 modularai/replit-code-1.5:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf modularai/replit-code-1.5:BF16
Use Docker
docker model run hf.co/modularai/replit-code-1.5:BF16
- LM Studio
- Jan
- Ollama
How to use modularai/replit-code-1.5 with Ollama:
ollama run hf.co/modularai/replit-code-1.5:BF16
- Unsloth Studio
How to use modularai/replit-code-1.5 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for modularai/replit-code-1.5 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for modularai/replit-code-1.5 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for modularai/replit-code-1.5 to start chatting
- Docker Model Runner
How to use modularai/replit-code-1.5 with Docker Model Runner:
docker model run hf.co/modularai/replit-code-1.5:BF16
- Lemonade
How to use modularai/replit-code-1.5 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull modularai/replit-code-1.5:BF16
Run and chat with the model
lemonade run user.replit-code-1.5-BF16
List all available models
lemonade list
Add tokenizer and templating config
Browse files- config.json +55 -0
- tokenizer.json +0 -0
- tokenizer_config.json +27 -0
config.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"MPTForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attn_config": {
|
| 6 |
+
"alibi": true,
|
| 7 |
+
"alibi_bias_max": 8,
|
| 8 |
+
"attn_impl": "torch",
|
| 9 |
+
"attn_pdrop": 0.0,
|
| 10 |
+
"attn_type": "grouped_query_attention",
|
| 11 |
+
"attn_uses_sequence_id": false,
|
| 12 |
+
"clip_qkv": null,
|
| 13 |
+
"kv_n_heads": 8,
|
| 14 |
+
"prefix_lm": false,
|
| 15 |
+
"qk_ln": false,
|
| 16 |
+
"softmax_scale": null
|
| 17 |
+
},
|
| 18 |
+
"auto_map": {
|
| 19 |
+
"AutoConfig": "configuration_mpt.MPTConfig",
|
| 20 |
+
"AutoModelForCausalLM": "modeling_mpt.MPTForCausalLM"
|
| 21 |
+
},
|
| 22 |
+
"d_model": 3072,
|
| 23 |
+
"emb_pdrop": 0.0,
|
| 24 |
+
"embedding_fraction": 1.0,
|
| 25 |
+
"expansion_ratio": 4,
|
| 26 |
+
"fc_type": "torch",
|
| 27 |
+
"ffn_config": {
|
| 28 |
+
"fc_type": "torch",
|
| 29 |
+
"ffn_type": "mptmlp"
|
| 30 |
+
},
|
| 31 |
+
"init_config": {
|
| 32 |
+
"emb_init_std": null,
|
| 33 |
+
"emb_init_uniform_lim": null,
|
| 34 |
+
"fan_mode": "fan_in",
|
| 35 |
+
"init_div_is_residual": true,
|
| 36 |
+
"init_gain": 0.0,
|
| 37 |
+
"init_nonlinearity": "relu",
|
| 38 |
+
"init_std": null,
|
| 39 |
+
"name": "kaiming_normal_"
|
| 40 |
+
},
|
| 41 |
+
"init_device": "cpu",
|
| 42 |
+
"learned_pos_emb": false,
|
| 43 |
+
"logit_scale": null,
|
| 44 |
+
"max_seq_len": 4096,
|
| 45 |
+
"model_type": "mpt",
|
| 46 |
+
"n_heads": 24,
|
| 47 |
+
"n_layers": 32,
|
| 48 |
+
"no_bias": true,
|
| 49 |
+
"norm_type": "low_precision_layernorm",
|
| 50 |
+
"resid_pdrop": 0.0,
|
| 51 |
+
"torch_dtype": "bfloat16",
|
| 52 |
+
"transformers_version": "4.33.3",
|
| 53 |
+
"use_cache": false,
|
| 54 |
+
"vocab_size": 32768
|
| 55 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"additional_special_tokens": [
|
| 4 |
+
"<fim_prefix>",
|
| 5 |
+
"<fim_middle>",
|
| 6 |
+
"<fim_suffix>",
|
| 7 |
+
"<fim_eot>",
|
| 8 |
+
"<fim_pad>",
|
| 9 |
+
"[INST]",
|
| 10 |
+
"[/INST]",
|
| 11 |
+
"<extra_id_2>",
|
| 12 |
+
"<extra_id_3>",
|
| 13 |
+
"<extra_id_4>",
|
| 14 |
+
"<extra_id_5>",
|
| 15 |
+
"<extra_id_6>",
|
| 16 |
+
"<extra_id_7>",
|
| 17 |
+
"<extra_id_8>",
|
| 18 |
+
"<extra_id_9>",
|
| 19 |
+
"<extra_id_10>"
|
| 20 |
+
],
|
| 21 |
+
"bos_token": "<|endoftext|>",
|
| 22 |
+
"clean_up_tokenization_spaces": false,
|
| 23 |
+
"eos_token": "<|endoftext|>",
|
| 24 |
+
"model_max_length": 4096,
|
| 25 |
+
"tokenizer_class": "GPTNeoXTokenizer",
|
| 26 |
+
"unk_token": "<|endoftext|>"
|
| 27 |
+
}
|