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
| // | |
| // common/ngram-map.h: structures used to manage a map from n-grams to a list of m-grams | |
| // | |
| // These structures are used to do a lookup of n-grams followed by m-grams in token history. | |
| // | |
| // There are two algorithms implemented: | |
| // 1. ngram_simple: lookup of n-grams followed by m-grams in token history. | |
| // 2. ngram_map: lookup of n-grams followed by m-grams in token history using a map. | |
| // The map is a vector of key n-grams, and for each key n-gram there is a list of value m-grams. | |
| // | |
| // ref: https://github.com/ggml-org/llama.cpp/pull/18471 | |
| // | |
| // n-gram simple | |
| // | |
| // config of n-gram simple. | |
| struct common_ngram_simple_config { | |
| uint16_t size_ngram; // size of n-grams to lookup in self-mode | |
| uint16_t size_mgram; // size of m-grams to draft in self-mode | |
| }; | |
| // Searches for a n-gram in the history and checks whether a draft sequence should be generated. | |
| llama_tokens common_ngram_simple_draft( | |
| const common_ngram_simple_config & config, | |
| const llama_tokens & tokens, llama_token sampled); | |
| // n-gram map | |
| // | |
| // maximum number of m-gram values stored for each key n-gram. | |
| // number of entries in the (optional, size 0 to disable) map from ngram-hash to ngram-index. | |
| // statistics of a m-gram after a known n-gram | |
| struct common_ngram_map_value { | |
| size_t value_idx = 0; // index of value m-gram in token-history (0 if unused) | |
| uint16_t value_num = 0; // number of occurrences of this value m-gram after the key n-gram (0 in an unused values-slot) | |
| int16_t n_accepted = -1; // number of accepted tokens at last draft (-1 if unused) | |
| }; | |
| // statistics of a n-gram | |
| struct common_ngram_map_key { | |
| size_t key_idx; // index of key n-gram in token-history | |
| size_t stat_idx; // index of last token of statistics computation (key_num, values) | |
| uint16_t key_num; // number of occurrences of this key n-gram in token-history | |
| common_ngram_map_value values[COMMON_NGRAM_MAX_VALUES]; // some known values after the key | |
| }; | |
| // map from n-grams to following m-grams in token-history | |
| struct common_ngram_map { | |
| uint16_t size_key; // size of key n-grams | |
| uint16_t size_value; // size of value m-grams | |
| bool key_only; // true if only key n-grams are used, no values. | |
| std::vector<common_ngram_map_key> keys; // key n-grams which occur several times in token-history | |
| uint16_t min_hits; // minimum number of key hits to consider a draft | |
| bool show_key_map_stats = false; // true, if statistics of the key_map should be printed. | |
| common_ngram_map(uint16_t sz_key, uint16_t sz_value, bool only_keys, | |
| uint16_t min_hits) | |
| : size_key(sz_key), size_value(sz_value), key_only(only_keys), | |
| min_hits(min_hits) { | |
| key_map.resize(COMMON_NGRAM_HASH_MAP_SIZE); // 2^18 hash entries, 0 entries if key_map shouldn't be used | |
| } | |
| // In reasoning chats the previous reasoning block will be removed from context history. | |
| // A rebuild of the ngram map is needed after that. | |
| size_t size_last_begin = 0; // number of tokens at previous start of generation | |
| bool last_draft_created = false; // true if a draft was created at last call. | |
| size_t last_draft_key_idx = 0; // index of last key used for draft generation (0 = no draft) | |
| uint16_t last_draft_value_idx = 0; // index of last value used for draft generation. | |
| size_t idx_last_check = 0; // index of last check in context history | |
| // optional map "hash to ngram-index" for faster lookup of n-grams. map is empty if unused. | |
| // | |
| // uint32_t instead of size_t (size of current histories is << UINT32_MAX) | |
| std::vector<uint32_t> key_map; // key_map[hash] = index of ngram in context window | |
| uint32_t key_map_last_idx = 0; // index of the last ngram added to key_map | |
| }; | |
| // Initialize the n-gram map with the given token history. | |
| // map: the ngram map to initialize. | |
| // tokens: the token history to base the map on. | |
| void common_ngram_map_begin( | |
| common_ngram_map & map, | |
| const llama_tokens & tokens); | |
| // Searches for the n-gram in the history and checks whether a draft sequence should be generated. | |
| // map: the ngram map to search in. | |
| // inp: the tokens generated so far. | |
| // sampled: the token that was just sampled. | |
| // draft: vector to store the draft tokens, initially empty. | |
| void common_ngram_map_draft( | |
| common_ngram_map & map, | |
| const llama_tokens & inp, llama_token sampled, | |
| llama_tokens & draft); | |
| // Update the statistics of a value after a draft was processed. | |
| void common_ngram_map_accept(common_ngram_map & map, uint16_t n_accepted); | |