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
| static inline void hmx_lock(struct hmx_queue *q) | |
| { | |
| if (!q->hmx_locked) { | |
| HAP_compute_res_hmx_lock(q->hap_rctx); | |
| q->hmx_locked = true; | |
| } | |
| } | |
| static inline void hmx_unlock(struct hmx_queue *q) | |
| { | |
| if (q->hmx_locked) { | |
| HAP_compute_res_hmx_unlock(q->hap_rctx); | |
| q->hmx_locked = false; | |
| } | |
| } | |
| static inline void hmx_queue_process(struct hmx_queue *q, bool* killed) { | |
| unsigned int ir = atomic_load(&q->idx_read); | |
| while (ir != atomic_load(&q->idx_write)) { | |
| struct hmx_queue_desc *d = &q->desc[ir]; | |
| if (!d->done) { | |
| FARF(HIGH, "hmx-queue-process: ir %u func %p data %p", ir, d->func, d->data); | |
| enum hmx_queue_signal sig = (enum hmx_queue_signal) (unsigned int) d->func; | |
| switch (sig) { | |
| case HMX_QUEUE_NOOP: /* noop */; break; | |
| case HMX_QUEUE_KILL: *killed = true; break; | |
| case HMX_QUEUE_SUSPEND: hmx_unlock(q); break; | |
| default: | |
| hmx_lock(q); | |
| htp_trace_event_start(q->trace, HTP_TRACE_EVT_HMX_COMP, ir); | |
| d->func(d->data); | |
| htp_trace_event_stop(q->trace, HTP_TRACE_EVT_HMX_COMP, ir); | |
| break; | |
| } | |
| atomic_fetch_add(&d->done, 1); | |
| } | |
| ir = (ir + 1) & q->idx_mask; | |
| atomic_store(&q->idx_read, ir); | |
| } | |
| } | |
| static void hmx_queue_thread(void * arg) { | |
| struct hmx_queue * q = (struct hmx_queue *) arg; | |
| FARF(HIGH, "hmx-queue-thread: started"); | |
| bool killed = false; | |
| unsigned int poll_cnt = HMX_QUEUE_POLL_COUNT; | |
| unsigned int prev_seqn = 0; | |
| while (!killed) { | |
| unsigned int seqn = atomic_load(&q->seqn); | |
| if (seqn == prev_seqn) { | |
| if (--poll_cnt) { hex_pause(); continue; } | |
| FARF(HIGH, "hmx-queue-thread: sleeping"); | |
| qurt_futex_wait(&q->seqn, prev_seqn); | |
| continue; | |
| } | |
| prev_seqn = seqn; | |
| poll_cnt = HMX_QUEUE_POLL_COUNT; | |
| FARF(HIGH, "hmx-queue-thread: new work"); | |
| hmx_queue_process(q, &killed); | |
| } | |
| FARF(HIGH, "hmx-queue-thread: stopped"); | |
| } | |
| struct hmx_queue * hmx_queue_create(size_t capacity, uint32_t hap_rctx) { | |
| capacity = hex_ceil_pow2(capacity); | |
| struct hmx_queue * q = (struct hmx_queue *) memalign(32, sizeof(struct hmx_queue)); | |
| if (q == NULL) { | |
| FARF(ERROR, "%s: failed to allocate DMA queue\n", __FUNCTION__); | |
| return NULL; | |
| } | |
| memset(q, 0, sizeof(struct hmx_queue)); | |
| q->capacity = capacity; | |
| q->idx_mask = capacity - 1; | |
| q->hap_rctx = hap_rctx; | |
| q->desc = (struct hmx_queue_desc *) memalign(64, capacity * sizeof(struct hmx_queue_desc)); | |
| if (!q->desc) { | |
| FARF(ERROR, "hmx-queue: failed to allocate HMX queue descriptors\n"); | |
| return NULL; | |
| } | |
| memset(q->desc, 0, capacity * sizeof(struct hmx_queue_desc)); | |
| const size_t stack_size = HMX_QUEUE_THREAD_STACK_SIZE; | |
| q->stack = (unsigned char *) memalign(64, stack_size); | |
| if (!q->stack) { | |
| FARF(ERROR, "hmx-queue: thread stack allocation failed (%zu bytes)", stack_size); | |
| return NULL; | |
| } | |
| memset(q->stack, 0, stack_size); | |
| // Match caller thread priority (same pattern as worker-pool.c). | |
| int prio = qurt_thread_get_priority(qurt_thread_get_id()); | |
| if (prio < 1) { | |
| prio = 1; | |
| } | |
| if (prio > QURT_LOWEST_PRIO) { | |
| prio = QURT_LOWEST_PRIO; | |
| } | |
| qurt_thread_attr_t attr; | |
| qurt_thread_attr_init(&attr); | |
| qurt_thread_attr_set_stack_addr(&attr, q->stack); | |
| qurt_thread_attr_set_stack_size(&attr, stack_size); | |
| qurt_thread_attr_set_priority(&attr, prio); | |
| qurt_thread_attr_set_name(&attr, "hmx-queue"); | |
| int err = qurt_thread_create(&q->thread, &attr, hmx_queue_thread, q); | |
| if (err) { | |
| FARF(ERROR, "hmx-worker: thread create failed (%d)", err); | |
| return NULL; | |
| } | |
| FARF(HIGH, "hmx-queue: capacity %u\n", capacity); | |
| return q; | |
| } | |
| void hmx_queue_delete(struct hmx_queue * q) { | |
| if (!q) { | |
| return; | |
| } | |
| // Tell the worker to exit. | |
| hmx_queue_flush(q); | |
| hmx_queue_signal(q, HMX_QUEUE_KILL); | |
| hmx_queue_flush(q); | |
| int status; | |
| qurt_thread_join(q->thread, &status); | |
| free(q->desc); | |
| free(q->stack); | |
| free(q); | |
| } | |