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
| struct graph_key { | |
| int n_nodes; | |
| std::string first_node_name; | |
| std::string last_node_name; | |
| graph_key(const ggml_cgraph * cgraph) : n_nodes(cgraph->n_nodes) { | |
| if (n_nodes > 0) { | |
| first_node_name = cgraph->nodes[0]->name; | |
| last_node_name = cgraph->nodes[n_nodes - 1]->name; | |
| } | |
| } | |
| bool operator==(const graph_key & other) const { | |
| return n_nodes == other.n_nodes && first_node_name == other.first_node_name && | |
| last_node_name == other.last_node_name; | |
| } | |
| }; | |
| struct graph_key_hash { | |
| size_t operator()(const graph_key & key) const { | |
| size_t h = std::hash<int>{}(key.n_nodes); | |
| if (key.n_nodes > 0) { | |
| h ^= std::hash<std::string>{}(key.first_node_name) + 0x9e3779b9 + (h << 6) + (h >> 2); | |
| h ^= std::hash<std::string>{}(key.last_node_name) + 0x9e3779b9 + (h << 6) + (h >> 2); | |
| } | |
| return h; | |
| } | |
| }; | |
| struct decoder_runtime_ctx { | |
| decoder_runtime_ctx(std::shared_ptr<std::mutex> mutex) : mutex(std::move(mutex)) {} | |
| std::shared_ptr<std::mutex> mutex; | |
| std::shared_ptr<GgmlOvDecoder> ptr; | |
| }; | |
| struct ov_runtime_context { | |
| mutable std::mutex ctx_mutex; | |
| std::string device; | |
| bool stateful; | |
| std::unordered_map<graph_key, std::shared_ptr<decoder_runtime_ctx>, graph_key_hash> decoder_cache; | |
| std::unordered_map<graph_key, std::shared_ptr<ov::InferRequest>, graph_key_hash> infer_request_cache; | |
| std::unordered_map<graph_key, std::shared_ptr<ov::InferRequest>, graph_key_hash> infer_request_cache_prefill; | |
| std::unordered_map<graph_key, std::vector<std::string>, graph_key_hash> ov_input_names_cache; | |
| std::unordered_map<graph_key, std::vector<std::string>, graph_key_hash> ov_output_names_cache; | |
| //TODO: Stateful is only supported for single request at a time. | |
| // Simultanous stateful inference request support to be added. | |
| size_t stateful_kv_size; | |
| std::map<std::string, std::string> kv_state_input_name_map; | |
| std::atomic<int> backend_count; | |
| ov_runtime_context() : device("CPU"), stateful(false), stateful_kv_size(0), backend_count(0) {} | |
| void clear_caches() { | |
| std::lock_guard<std::mutex> lock(ctx_mutex); | |
| decoder_cache.clear(); | |
| infer_request_cache.clear(); | |
| infer_request_cache_prefill.clear(); | |
| ov_input_names_cache.clear(); | |
| ov_output_names_cache.clear(); | |
| } | |
| }; | |
| enum ggml_status ov_graph_compute(struct ggml_cgraph * cgraph, ggml_backend_t backend); | |
| enum ggml_status ov_graph_compute_dynamic(struct ggml_cgraph * cgraph, std::shared_ptr<ov_runtime_context> r_ctx); | |
| enum ggml_status ov_graph_compute_static(struct ggml_cgraph * cgraph, std::shared_ptr<ov_runtime_context> r_ctx); | |
| size_t checksum(const void * data, size_t size); | |
| bool save_ggml_tensor_data_to_txt(const ggml_tensor * tensor, const std::string & file_path); | |
| void print_input_tensor_info(const std::string & name, const ov::Tensor & tensor); | |
| void print_output_tensor_info(const std::string & name, const ov::Tensor & tensor, const void * output_dst); | |
| template <typename T> | |
| std::vector<T> pad_input(const T * data, | |
| size_t rows, | |
| size_t cols, | |
| size_t padded_rows, | |
| size_t padded_cols, | |
| T pad_value) { | |
| std::vector<T> padded(padded_rows * padded_cols, pad_value); | |
| for (size_t i = 0; i < std::min(rows, padded_rows); ++i) { | |
| for (size_t j = 0; j < std::min(cols, padded_cols); ++j) { | |
| padded[i * padded_cols + j] = data[i * cols + j]; | |
| } | |
| } | |
| return padded; | |
| } | |
| template <typename T> | |
| std::vector<T> pad_input(const ggml_tensor * tensor, size_t padded_rows, size_t padded_cols, T pad_value) { | |
| return pad_input<T>(reinterpret_cast<const T *>(tensor->data), | |
| static_cast<size_t>(tensor->ne[1]), // rows | |
| static_cast<size_t>(tensor->ne[0]), // cols | |
| padded_rows, padded_cols, pad_value); | |
| } | |
| const ggml_tensor * get_inp_pos_tensor(struct ggml_cgraph * cgraph); | |
| bool get_is_prefill(const ggml_tensor * inp_pos); | |
| ov::Tensor get_ov_input_tensor(std::shared_ptr<GgmlOvDecoder> ggml_decoder, const std::string & param_name); | |
| ov::Tensor get_ov_input_tensor_static_decode(std::shared_ptr<GgmlOvDecoder> ggml_decoder, | |
| const std::string & param_name); | |
| ov::Tensor get_ov_input_tensor_static_prefill(std::shared_ptr<GgmlOvDecoder> ggml_decoder, | |
| const std::string & param_name, | |
| int chunk_index); | |
| ov::Tensor create_ov_output_tensor(std::shared_ptr<GgmlOvDecoder> ggml_decoder, | |
| std::shared_ptr<ov::InferRequest> infer_request, | |
| int output_index, | |
| const ggml_tensor * ggml_tensor); | |
| bool is_naive(struct ggml_cgraph * cgraph); | |
| /** | |
| * @brief Heuristically checks whether the given computation graph is a split-model fragment. | |
| * @param cgraph Pointer to the GGML computation graph to analyze. | |
| * @return true if the graph is identified as split; otherwise false. | |
| */ | |
| bool is_model_splitted(struct ggml_cgraph * cgraph); | |
| enum ggml_status naive_compute(struct ggml_cgraph * cgraph, | |
| ov::Core & core, | |
| const std::string & device, | |
| const ov::AnyMap & config); | |