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 void * backend_library_handle = NULL; | |
| static FILE * apir_logfile = NULL; | |
| static void log_to_file_callback(enum ggml_log_level level, const char * text, void * user_data) { | |
| FILE * logfile = (FILE *) user_data; | |
| fprintf(logfile, "[%d] %s", level, text); | |
| fflush(logfile); | |
| } | |
| extern "C" { | |
| void apir_backend_deinit(uint32_t virgl_ctx_id) { | |
| GGML_UNUSED(virgl_ctx_id); | |
| auto buffers = apir_get_track_backend_buffers(); | |
| for (const auto & buffer : buffers) { | |
| apir_untrack_backend_buffer(buffer); | |
| buffer->iface.free_buffer(buffer); | |
| } | |
| if (backend_library_handle) { | |
| GGML_LOG_INFO(GGML_VIRTGPU_BCK "The GGML backend library was loaded. Unloading it.\n"); | |
| dlclose(backend_library_handle); | |
| backend_library_handle = NULL; | |
| } | |
| if (apir_logfile) { | |
| fclose(apir_logfile); | |
| apir_logfile = NULL; | |
| } | |
| } | |
| ApirLoadLibraryReturnCode apir_backend_initialize(uint32_t virgl_ctx_id, struct virgl_apir_callbacks * virgl_cbs) { | |
| const char * dlsym_error; | |
| const char * apir_log_to_file = getenv(APIR_LLAMA_CPP_LOG_TO_FILE_ENV); | |
| if (apir_log_to_file) { | |
| apir_logfile = fopen(apir_log_to_file, "w"); | |
| if (apir_logfile) { | |
| ggml_log_set(log_to_file_callback, apir_logfile); | |
| } else { | |
| GGML_LOG_INFO(GGML_VIRTGPU_BCK "Could not open the log file at '%s'\n", apir_log_to_file); | |
| } | |
| } | |
| const char * library_name = virgl_cbs->get_config(virgl_ctx_id, APIR_GGML_LIBRARY_PATH_KEY); | |
| const char * virgl_library_reg = virgl_cbs->get_config(virgl_ctx_id, APIR_GGML_LIBRARY_REG_KEY); | |
| const char * library_reg = virgl_library_reg ? virgl_library_reg : GGML_DEFAULT_BACKEND_REG; | |
| if (!library_name) { | |
| GGML_LOG_ERROR(GGML_VIRTGPU_BCK "%s: cannot open the GGML library: env var '%s' not defined\n", __func__, | |
| APIR_LLAMA_CPP_GGML_LIBRARY_PATH_ENV); | |
| return APIR_LOAD_LIBRARY_ENV_VAR_MISSING; | |
| } | |
| backend_library_handle = dlopen(library_name, RTLD_LAZY); | |
| if (!backend_library_handle) { | |
| GGML_LOG_ERROR(GGML_VIRTGPU_BCK "%s: cannot open the GGML library: %s\n", __func__, dlerror()); | |
| return APIR_LOAD_LIBRARY_CANNOT_OPEN; | |
| } | |
| if (!library_reg) { | |
| GGML_LOG_ERROR(GGML_VIRTGPU_BCK "%s: cannot register the GGML library: env var '%s' not defined\n", __func__, | |
| APIR_LLAMA_CPP_GGML_LIBRARY_REG_ENV); | |
| return APIR_LOAD_LIBRARY_ENV_VAR_MISSING; | |
| } | |
| void * ggml_backend_reg_fct = dlsym(backend_library_handle, library_reg); | |
| dlsym_error = dlerror(); | |
| if (dlsym_error) { | |
| GGML_LOG_ERROR(GGML_VIRTGPU_BCK "%s: cannot find the GGML backend registration symbol '%s' (from %s): %s\n", | |
| __func__, library_reg, APIR_LLAMA_CPP_GGML_LIBRARY_REG_ENV, dlsym_error); | |
| return APIR_LOAD_LIBRARY_SYMBOL_MISSING; | |
| } | |
| uint32_t ret = backend_dispatch_initialize(ggml_backend_reg_fct); | |
| return (ApirLoadLibraryReturnCode) (APIR_LOAD_LIBRARY_INIT_BASE_INDEX + ret); | |
| } | |
| uint32_t apir_backend_dispatcher(uint32_t virgl_ctx_id, | |
| virgl_apir_callbacks * virgl_cbs, | |
| uint32_t cmd_type, | |
| char * dec_cur, | |
| const char * dec_end, | |
| char * enc_cur, | |
| const char * enc_end, | |
| char ** enc_cur_after) { | |
| apir_encoder enc = { | |
| .cur = enc_cur, | |
| .start = enc_cur, | |
| .end = enc_end, | |
| .fatal = false, | |
| }; | |
| apir_decoder dec = { | |
| .cur = dec_cur, | |
| .end = dec_end, | |
| .fatal = false, | |
| }; | |
| virgl_apir_context ctx = { | |
| .ctx_id = virgl_ctx_id, | |
| .iface = virgl_cbs, | |
| }; | |
| if (cmd_type >= APIR_BACKEND_DISPATCH_TABLE_COUNT) { | |
| GGML_LOG_ERROR(GGML_VIRTGPU_BCK "%s: Received an invalid dispatch index (%d >= %d)\n", __func__, cmd_type, | |
| APIR_BACKEND_DISPATCH_TABLE_COUNT); | |
| return APIR_BACKEND_FORWARD_INDEX_INVALID; | |
| } | |
| backend_dispatch_t forward_fct = apir_backend_dispatch_table[cmd_type]; | |
| uint32_t ret = forward_fct(&enc, &dec, &ctx); | |
| *enc_cur_after = enc.cur; | |
| return ret; | |
| } | |
| } | |