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
| // | |
| // MIT license | |
| // Copyright (C) 2024 Intel Corporation | |
| // SPDX-License-Identifier: MIT | |
| // | |
| // | |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| // See https://llvm.org/LICENSE.txt for license information. | |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| // | |
| int get_current_device_id() { | |
| return dpct::dev_mgr::instance().current_device_id(); | |
| } | |
| void* ggml_sycl_host_malloc(size_t size) try { | |
| if (getenv("GGML_SYCL_NO_PINNED") != nullptr) { | |
| return nullptr; | |
| } | |
| void* ptr = nullptr; | |
| // allow to use dpct::get_in_order_queue() for host malloc | |
| dpct::err0 err = CHECK_TRY_ERROR( | |
| ptr = (void*)sycl::malloc_host(size, dpct::get_in_order_queue())); | |
| if (err != 0) { | |
| // clear the error | |
| GGML_LOG_ERROR("WARNING: failed to allocate %.2f MB of pinned memory: %s\n", size / 1024.0 / 1024.0, "syclGetErrorString is not supported"); | |
| return nullptr; | |
| } | |
| return ptr; | |
| } catch (sycl::exception const& exc) { | |
| std::cerr << exc.what() << "Exception caught at file:" << __FILE__ | |
| << ", line:" << __LINE__ << std::endl; | |
| std::exit(1); | |
| } | |
| void ggml_sycl_host_free(void* ptr) try { | |
| // allow to use dpct::get_in_order_queue() for host malloc | |
| SYCL_CHECK(CHECK_TRY_ERROR(sycl::free(ptr, dpct::get_in_order_queue()))); | |
| } catch (sycl::exception const& exc) { | |
| std::cerr << exc.what() << "Exception caught at file:" << __FILE__ | |
| << ", line:" << __LINE__ << std::endl; | |
| std::exit(1); | |
| } | |
| bool gpu_has_xmx(sycl::device &dev) { | |
| return dev.has(sycl::aspect::ext_intel_matrix); | |
| } | |
| int ggml_sycl_get_env(const char *env_name, int default_val) { | |
| char *user_device_string = getenv(env_name); | |
| int user_number = default_val; | |
| unsigned n; | |
| if (user_device_string != NULL && | |
| sscanf(user_device_string, " %u", &n) == 1) { | |
| user_number = (int)n; | |
| } else { | |
| user_number = default_val; | |
| } | |
| return user_number; | |
| } | |
| int64_t downsample_sycl_global_range(int64_t accumulate_block_num, int64_t block_size) { | |
| const int64_t max_range = std::numeric_limits<int>::max(); | |
| int64_t sycl_down_blk_size = block_size; | |
| int64_t global_range = accumulate_block_num * sycl_down_blk_size; | |
| while(global_range > max_range) { | |
| sycl_down_blk_size /= 2; | |
| global_range = accumulate_block_num * sycl_down_blk_size; | |
| } | |
| return sycl_down_blk_size; | |
| } | |
| static bool ggml_sycl_use_level_zero_device_alloc(sycl::queue &q) { | |
| return g_ggml_sycl_use_level_zero_api && | |
| q.get_device().is_gpu() && | |
| q.get_backend() == sycl::backend::ext_oneapi_level_zero; | |
| } | |
| // Use Level Zero zeMemAllocDevice to avoid sycl::malloc_device triggering | |
| // DMA-buf/TTM system RAM staging in the xe kernel driver during multi-GPU inference. | |
| void * ggml_sycl_malloc_device(size_t size, sycl::queue &q) { | |
| if (ggml_sycl_use_level_zero_device_alloc(q)) { | |
| void *ptr = nullptr; | |
| auto ze_ctx = sycl::get_native<sycl::backend::ext_oneapi_level_zero>(q.get_context()); | |
| auto ze_dev = sycl::get_native<sycl::backend::ext_oneapi_level_zero>(q.get_device()); | |
| ze_relaxed_allocation_limits_exp_desc_t relaxed_desc = { | |
| ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC, | |
| nullptr, | |
| ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE, | |
| }; | |
| ze_device_mem_alloc_desc_t alloc_desc = { | |
| ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC, | |
| &relaxed_desc, | |
| 0, | |
| 0, | |
| }; | |
| ze_device_mem_alloc_desc_t alloc_desc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC, nullptr, 0, 0}; | |
| ze_result_t r = zeMemAllocDevice(ze_ctx, &alloc_desc, size, 64, ze_dev, &ptr); | |
| if (r == ZE_RESULT_SUCCESS && ptr) { | |
| return ptr; | |
| } | |
| return nullptr; | |
| } | |
| return sycl::malloc_device(size, q); | |
| } | |
| void ggml_sycl_free_device(void *ptr, sycl::queue &q) { | |
| if (!ptr) return; | |
| if (ggml_sycl_use_level_zero_device_alloc(q)) { | |
| auto ze_ctx = sycl::get_native<sycl::backend::ext_oneapi_level_zero>(q.get_context()); | |
| zeMemFree(ze_ctx, ptr); | |
| return; | |
| } | |
| SYCL_CHECK(CHECK_TRY_ERROR(sycl::free(ptr, q))); | |
| } | |
| void release_extra_gpu(ggml_tensor_extra_gpu * extra, std::vector<queue_ptr> streams) { | |
| for (int i = 0; i < ggml_sycl_info().device_count; ++i) { | |
| for (int64_t is = 0; is < GGML_SYCL_MAX_STREAMS; ++is) { | |
| if (extra->events[i][is] != nullptr) { | |
| SYCL_CHECK(CHECK_TRY_ERROR(dpct::destroy_event(extra->events[i][is]))); | |
| } | |
| } | |
| if (extra->data_device[i] != nullptr && streams.size()>0) { | |
| ggml_sycl_set_device(i); | |
| SYCL_CHECK(CHECK_TRY_ERROR(ggml_sycl_free_device(extra->data_device[i], *(streams[i])))); | |
| } | |
| } | |
| delete extra; | |
| } | |