Text Generation
Transformers
Safetensors
GGUF
phi3
conversational
custom_code
text-generation-inference
Instructions to use SciPhi/Triplex with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SciPhi/Triplex with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SciPhi/Triplex", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SciPhi/Triplex", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("SciPhi/Triplex", trust_remote_code=True) 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]:])) - llama-cpp-python
How to use SciPhi/Triplex with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="SciPhi/Triplex", filename="quantized_model-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SciPhi/Triplex with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf SciPhi/Triplex:Q4_K_M # Run inference directly in the terminal: llama-cli -hf SciPhi/Triplex:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf SciPhi/Triplex:Q4_K_M # Run inference directly in the terminal: llama-cli -hf SciPhi/Triplex:Q4_K_M
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 SciPhi/Triplex:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf SciPhi/Triplex:Q4_K_M
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 SciPhi/Triplex:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf SciPhi/Triplex:Q4_K_M
Use Docker
docker model run hf.co/SciPhi/Triplex:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use SciPhi/Triplex with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SciPhi/Triplex" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SciPhi/Triplex", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SciPhi/Triplex:Q4_K_M
- SGLang
How to use SciPhi/Triplex 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 "SciPhi/Triplex" \ --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": "SciPhi/Triplex", "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 "SciPhi/Triplex" \ --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": "SciPhi/Triplex", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use SciPhi/Triplex with Ollama:
ollama run hf.co/SciPhi/Triplex:Q4_K_M
- Unsloth Studio
How to use SciPhi/Triplex 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 SciPhi/Triplex 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 SciPhi/Triplex to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SciPhi/Triplex to start chatting
- Docker Model Runner
How to use SciPhi/Triplex with Docker Model Runner:
docker model run hf.co/SciPhi/Triplex:Q4_K_M
- Lemonade
How to use SciPhi/Triplex with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SciPhi/Triplex:Q4_K_M
Run and chat with the model
lemonade run user.Triplex-Q4_K_M
List all available models
lemonade list
Update config.json
Browse files- config.json +8 -111
config.json
CHANGED
|
@@ -3,12 +3,10 @@
|
|
| 3 |
"architectures": [
|
| 4 |
"Phi3ForCausalLM"
|
| 5 |
],
|
| 6 |
-
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"auto_map": {
|
| 9 |
-
"AutoConfig": "
|
| 10 |
-
"
|
| 11 |
-
"AutoModelForCausalLM": "microsoft/Phi-3-mini-128k-instruct--modeling_phi3.Phi3ForCausalLM"
|
| 12 |
},
|
| 13 |
"bos_token_id": 1,
|
| 14 |
"embd_pdrop": 0.0,
|
|
@@ -17,7 +15,7 @@
|
|
| 17 |
"hidden_size": 3072,
|
| 18 |
"initializer_range": 0.02,
|
| 19 |
"intermediate_size": 8192,
|
| 20 |
-
"max_position_embeddings":
|
| 21 |
"model_type": "phi3",
|
| 22 |
"num_attention_heads": 32,
|
| 23 |
"num_hidden_layers": 32,
|
|
@@ -26,114 +24,13 @@
|
|
| 26 |
"pad_token_id": 32000,
|
| 27 |
"resid_pdrop": 0.0,
|
| 28 |
"rms_norm_eps": 1e-05,
|
| 29 |
-
"rope_scaling":
|
| 30 |
-
"long_factor": [
|
| 31 |
-
1.0700000524520874,
|
| 32 |
-
1.1200000047683716,
|
| 33 |
-
1.149999976158142,
|
| 34 |
-
1.4199999570846558,
|
| 35 |
-
1.5699999332427979,
|
| 36 |
-
1.7999999523162842,
|
| 37 |
-
2.129999876022339,
|
| 38 |
-
2.129999876022339,
|
| 39 |
-
3.009999990463257,
|
| 40 |
-
5.910000324249268,
|
| 41 |
-
6.950000286102295,
|
| 42 |
-
9.070000648498535,
|
| 43 |
-
9.930000305175781,
|
| 44 |
-
10.710000038146973,
|
| 45 |
-
11.130000114440918,
|
| 46 |
-
14.609999656677246,
|
| 47 |
-
15.409998893737793,
|
| 48 |
-
19.809999465942383,
|
| 49 |
-
37.279998779296875,
|
| 50 |
-
38.279998779296875,
|
| 51 |
-
38.599998474121094,
|
| 52 |
-
40.12000274658203,
|
| 53 |
-
46.20000457763672,
|
| 54 |
-
50.940006256103516,
|
| 55 |
-
53.66000747680664,
|
| 56 |
-
54.9373893737793,
|
| 57 |
-
56.89738845825195,
|
| 58 |
-
57.28738784790039,
|
| 59 |
-
59.98738479614258,
|
| 60 |
-
60.86738586425781,
|
| 61 |
-
60.887386322021484,
|
| 62 |
-
61.71739196777344,
|
| 63 |
-
62.91739273071289,
|
| 64 |
-
62.957393646240234,
|
| 65 |
-
63.41739273071289,
|
| 66 |
-
63.8173942565918,
|
| 67 |
-
63.83739471435547,
|
| 68 |
-
63.897396087646484,
|
| 69 |
-
63.93739700317383,
|
| 70 |
-
64.06739807128906,
|
| 71 |
-
64.11434936523438,
|
| 72 |
-
64.12435150146484,
|
| 73 |
-
64.15435028076172,
|
| 74 |
-
64.19435119628906,
|
| 75 |
-
64.24435424804688,
|
| 76 |
-
64.57435607910156,
|
| 77 |
-
64.69000244140625,
|
| 78 |
-
64.76000213623047
|
| 79 |
-
],
|
| 80 |
-
"short_factor": [
|
| 81 |
-
1.1,
|
| 82 |
-
1.1,
|
| 83 |
-
1.1,
|
| 84 |
-
1.3000000000000003,
|
| 85 |
-
1.3500000000000003,
|
| 86 |
-
1.3500000000000003,
|
| 87 |
-
1.4000000000000004,
|
| 88 |
-
1.5500000000000005,
|
| 89 |
-
2.000000000000001,
|
| 90 |
-
2.000000000000001,
|
| 91 |
-
2.000000000000001,
|
| 92 |
-
2.000000000000001,
|
| 93 |
-
2.000000000000001,
|
| 94 |
-
2.000000000000001,
|
| 95 |
-
2.000000000000001,
|
| 96 |
-
2.000000000000001,
|
| 97 |
-
2.000000000000001,
|
| 98 |
-
2.000000000000001,
|
| 99 |
-
2.000000000000001,
|
| 100 |
-
2.000000000000001,
|
| 101 |
-
2.000000000000001,
|
| 102 |
-
2.000000000000001,
|
| 103 |
-
2.000000000000001,
|
| 104 |
-
2.000000000000001,
|
| 105 |
-
2.000000000000001,
|
| 106 |
-
2.0500000000000007,
|
| 107 |
-
2.0500000000000007,
|
| 108 |
-
2.0500000000000007,
|
| 109 |
-
2.0500000000000007,
|
| 110 |
-
2.0500000000000007,
|
| 111 |
-
2.0500000000000007,
|
| 112 |
-
2.1000000000000005,
|
| 113 |
-
2.1000000000000005,
|
| 114 |
-
2.1500000000000004,
|
| 115 |
-
2.25,
|
| 116 |
-
2.25,
|
| 117 |
-
2.25,
|
| 118 |
-
2.25,
|
| 119 |
-
2.25,
|
| 120 |
-
2.3999999999999995,
|
| 121 |
-
2.4499999999999993,
|
| 122 |
-
2.499999999999999,
|
| 123 |
-
2.6999999999999984,
|
| 124 |
-
2.6999999999999984,
|
| 125 |
-
2.7499999999999982,
|
| 126 |
-
2.799999999999998,
|
| 127 |
-
2.8999999999999977,
|
| 128 |
-
3.049999999999997
|
| 129 |
-
],
|
| 130 |
-
"type": "yarn"
|
| 131 |
-
},
|
| 132 |
"rope_theta": 10000.0,
|
| 133 |
-
"sliding_window":
|
| 134 |
"tie_word_embeddings": false,
|
| 135 |
"torch_dtype": "bfloat16",
|
| 136 |
-
"transformers_version": "4.
|
| 137 |
-
"use_cache":
|
|
|
|
| 138 |
"vocab_size": 32064
|
| 139 |
}
|
|
|
|
| 3 |
"architectures": [
|
| 4 |
"Phi3ForCausalLM"
|
| 5 |
],
|
|
|
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_phi3.Phi3Config",
|
| 9 |
+
"AutoModelForCausalLM": "modeling_phi3.Phi3ForCausalLM"
|
|
|
|
| 10 |
},
|
| 11 |
"bos_token_id": 1,
|
| 12 |
"embd_pdrop": 0.0,
|
|
|
|
| 15 |
"hidden_size": 3072,
|
| 16 |
"initializer_range": 0.02,
|
| 17 |
"intermediate_size": 8192,
|
| 18 |
+
"max_position_embeddings": 4096,
|
| 19 |
"model_type": "phi3",
|
| 20 |
"num_attention_heads": 32,
|
| 21 |
"num_hidden_layers": 32,
|
|
|
|
| 24 |
"pad_token_id": 32000,
|
| 25 |
"resid_pdrop": 0.0,
|
| 26 |
"rms_norm_eps": 1e-05,
|
| 27 |
+
"rope_scaling": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
"rope_theta": 10000.0,
|
| 29 |
+
"sliding_window": 2047,
|
| 30 |
"tie_word_embeddings": false,
|
| 31 |
"torch_dtype": "bfloat16",
|
| 32 |
+
"transformers_version": "4.40.2",
|
| 33 |
+
"use_cache": true,
|
| 34 |
+
"attention_bias": false,
|
| 35 |
"vocab_size": 32064
|
| 36 |
}
|