Safetensors
GGUF
Turkish
llama
Llama-3
instruct
finetune
chatml
gpt4
synthetic data
distillation
function calling
json mode
axolotl
roleplaying
chat
Instructions to use tda45/TdAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use tda45/TdAI with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="tda45/TdAI", filename="llama.cpp/models/ggml-vocab-aquila.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 tda45/TdAI 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 tda45/TdAI # Run inference directly in the terminal: llama cli -hf tda45/TdAI
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tda45/TdAI # Run inference directly in the terminal: llama cli -hf tda45/TdAI
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 tda45/TdAI # Run inference directly in the terminal: ./llama-cli -hf tda45/TdAI
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 tda45/TdAI # Run inference directly in the terminal: ./build/bin/llama-cli -hf tda45/TdAI
Use Docker
docker model run hf.co/tda45/TdAI
- LM Studio
- Jan
- Ollama
How to use tda45/TdAI with Ollama:
ollama run hf.co/tda45/TdAI
- Unsloth Studio
How to use tda45/TdAI 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 tda45/TdAI 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 tda45/TdAI to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tda45/TdAI to start chatting
- Atomic Chat new
- Docker Model Runner
How to use tda45/TdAI with Docker Model Runner:
docker model run hf.co/tda45/TdAI
- Lemonade
How to use tda45/TdAI with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tda45/TdAI
Run and chat with the model
lemonade run user.TdAI-{{QUANT_TAG}}List all available models
lemonade list
| #ifdef USE_SUBGROUP_REDUCTION | |
| enable subgroups; | |
| #endif | |
| enable f16; | |
| requires packed_4x8_integer_dot_product; | |
| #include "common_decls.tmpl" | |
| struct Params { | |
| offset_src1: u32, | |
| stride_11: u32, | |
| stride_12: u32, | |
| stride_13: u32, | |
| ne0: u32, | |
| ne1: u32, | |
| ne2: u32, | |
| ne3: u32, | |
| }; | |
| #define SRC1_TYPE vec4<SRC1_INNER_TYPE> | |
| @group(0) @binding(0) var<storage, read_write> src1: array<SRC1_TYPE>; | |
| @group(0) @binding(1) var<storage, read_write> src1q: array<q8_1>; | |
| @group(0) @binding(2) var<uniform> params: Params; | |
| #ifdef USE_SUBGROUP_REDUCTION | |
| fn cluster_max_8(v: f32) -> f32 { | |
| var r = v; | |
| r = max(r, subgroupShuffleXor(r, 1u)); | |
| r = max(r, subgroupShuffleXor(r, 2u)); | |
| r = max(r, subgroupShuffleXor(r, 4u)); | |
| return r; | |
| } | |
| #if defined(MUL_ACC_Q4_0) || defined(MUL_ACC_Q4_1) || defined(MUL_ACC_Q4_K) | |
| fn cluster_add_i4x8(v: i32) -> i32 { | |
| var r= v; | |
| r += subgroupShuffleXor(r, 1u); | |
| r += subgroupShuffleXor(r, 2u); | |
| r += subgroupShuffleXor(r, 4u); | |
| return r; | |
| } | |
| #endif | |
| #endif | |
| #ifdef USE_WORKGROUP_REDUCTION | |
| #define CLUSTER_SIZE 8 | |
| var<workgroup> partial_amaxs: array<array<f32, CLUSTER_SIZE>, WG_SIZE / CLUSTER_SIZE>; | |
| var<workgroup> partial_sums: array<array<i32, CLUSTER_SIZE>, WG_SIZE / CLUSTER_SIZE>; | |
| #endif | |
| @compute @workgroup_size(WG_SIZE) | |
| fn main( | |
| @builtin(local_invocation_id) local_id: vec3<u32>, | |
| @builtin(workgroup_id) wg_id: vec3<u32>, | |
| @builtin(num_workgroups) num_wg: vec3<u32> | |
| ) { | |
| let thread_id = local_id.x; | |
| let ne0_vec4 = params.ne0 / 4u; | |
| let wg_per_vec = (ne0_vec4 + (WG_SIZE - 1u)) / WG_SIZE; | |
| let total_batches = wg_per_vec * params.ne1 * params.ne2 * params.ne3; | |
| let wg_linear = wg_id.y * num_wg.x + wg_id.x; | |
| if (wg_linear >= total_batches) { | |
| return; | |
| } | |
| let vec_idx = wg_linear / wg_per_vec; | |
| let src13_idx = vec_idx / (params.ne2 * params.ne1); | |
| let vec_ne12_num = vec_idx % (params.ne2 * params.ne1); | |
| let src12_idx = vec_ne12_num / params.ne1; | |
| let src11_idx = vec_ne12_num % params.ne1; | |
| let src1_idx_base = params.offset_src1 + src13_idx * params.stride_13 + src12_idx * params.stride_12 + src11_idx * params.stride_11; | |
| let src1_idx_vec4_base = src1_idx_base / 4u; | |
| let blocks_per_row = params.ne0 / 32u; | |
| let blocks_per_wg = (WG_SIZE * 4u) / 32u; | |
| let src1q_idx_base = ((src13_idx * params.ne2 + src12_idx) * params.ne1 + src11_idx) * blocks_per_row; | |
| let src11_wg_idx = wg_linear % wg_per_vec; | |
| let src1q_idx = src1q_idx_base + src11_wg_idx * blocks_per_wg + thread_id / 8u; | |
| let qs_idx = thread_id % 8u; | |
| // reduction | |
| var q4 = vec4<f32>(0.0); | |
| var q4_quants = 0u; | |
| var thread_amax = 0.0; | |
| let src11_vec4_idx = src11_wg_idx * WG_SIZE + thread_id; | |
| let is_valid = src11_vec4_idx < ne0_vec4; | |
| #ifdef USE_SUBGROUP_REDUCTION | |
| var d = 0.0; | |
| if (is_valid) { | |
| q4 = src1src1_idx_vec4_base + src11_vec4_idx; | |
| let abs_q4 = abs(q4); | |
| thread_amax = max(max(abs_q40u, abs_q41u), max(abs_q42, abs_q43)); | |
| } | |
| d = cluster_max_8(thread_amax) / 127.0; | |
| if (is_valid) { | |
| let id = select(0.0, 1.0 / d, d > 0.0); | |
| q4_quants = pack4xI8(vec4<i32>(round(q4 * id))); | |
| if (qs_idx == 0u) { | |
| src1qsrc1q_idx.d = f16(d); | |
| } | |
| src1qsrc1q_idx.qsqs_idx = q4_quants; | |
| } | |
| #if defined(MUL_ACC_Q4_0) || defined(MUL_ACC_Q4_1) || defined(MUL_ACC_Q4_K) | |
| let q4_quants_sum = dot4I8Packed(q4_quants, 0x01010101u); | |
| let s = f16(d * f32(cluster_add_i4x8(q4_quants_sum))); | |
| if (is_valid) { | |
| if (qs_idx == 0u) { | |
| src1qsrc1q_idx.s = s; | |
| } | |
| } | |
| #endif | |
| #endif | |
| #ifdef USE_WORKGROUP_REDUCTION | |
| var d = 0.0; | |
| let cluster_id = thread_id / 8u; | |
| if (is_valid) { | |
| q4 = src1src1_idx_vec4_base + src11_vec4_idx; | |
| let abs_q4 = abs(q4); | |
| thread_amax = max(max(abs_q40, abs_q41), max(abs_q42, abs_q43)); | |
| partial_amaxscluster_idqs_idx = thread_amax; | |
| } | |
| workgroupBarrier(); | |
| if (is_valid) { | |
| let amax = max( | |
| max( | |
| max(partial_amaxscluster_id0, partial_amaxscluster_id1), max(partial_amaxscluster_id2, partial_amaxscluster_id3)), | |
| max( | |
| max(partial_amaxscluster_id4, partial_amaxscluster_id5), max(partial_amaxscluster_id6, partial_amaxscluster_id7)) | |
| ); | |
| d = amax / 127.0; | |
| let id = select(0.0f, 1.0f / d, d > 0.0f); | |
| q4_quants = pack4xI8(vec4<i32>(round(q4 * id))); | |
| src1qsrc1q_idx.qsqs_idx = q4_quants; | |
| if (qs_idx == 0u) { | |
| src1qsrc1q_idx.d = f16(d); | |
| } | |
| } | |
| #if defined(MUL_ACC_Q4_0) || defined(MUL_ACC_Q4_1) || defined(MUL_ACC_Q4_K) | |
| partial_sumscluster_idqs_idx = dot4I8Packed(q4_quants, 0x01010101u); | |
| workgroupBarrier(); | |
| if (is_valid) { | |
| if (qs_idx == 0u) { | |
| let s = d * f32(partial_sumscluster_id0 + partial_sumscluster_id1 + partial_sumscluster_id2 + partial_sumscluster_id3 | |
| + partial_sumscluster_id4 + partial_sumscluster_id5 + partial_sumscluster_id6 + partial_sumscluster_id7); | |
| src1qsrc1q_idx.s = f16(s); | |
| } | |
| } | |
| #endif | |
| #endif | |
| } | |