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
| import { | |
| EXIF_SCAN_BYTE_LIMIT, | |
| JPEG_SOI_MARKER, | |
| APP1_MARKER, | |
| SOS_MARKER, | |
| EXIF_SIGNATURE, | |
| TIFF_LITTLE_ENDIAN, | |
| TIFF_MAGIC, | |
| EXIF_ORIENTATION_TAG, | |
| IFD_ENTRY_SIZE | |
| } from '$lib/constants/jpeg-exif'; | |
| import { MimeTypeImage } from '$lib/enums'; | |
| /** | |
| * Read the EXIF orientation tag from a JPEG base64 data URL | |
| * | |
| * Only a bounded prefix of the base64 payload is decoded, the APP1 segment | |
| * always sits near the start of the file. | |
| * @param base64UrlJpeg - The JPEG base64 data URL to inspect | |
| * @returns The orientation value (1 to 8), or 1 when absent or unreadable | |
| */ | |
| export function getJpegOrientationFromDataURL(base64UrlJpeg: string): number { | |
| try { | |
| const payloadStart = base64UrlJpeg.indexOf(',') + 1; | |
| if (payloadStart <= 0) { | |
| return 1; | |
| } | |
| // Keep the slice a multiple of 4 characters so atob accepts it | |
| const charLimit = Math.ceil(EXIF_SCAN_BYTE_LIMIT / 3) * 4; | |
| const slice = base64UrlJpeg.slice(payloadStart, payloadStart + charLimit); | |
| const binary = atob(slice.slice(0, slice.length - (slice.length % 4))); | |
| const bytes = new Uint8Array(binary.length); | |
| for (let i = 0; i < binary.length; i++) { | |
| bytes[i] = binary.charCodeAt(i); | |
| } | |
| return findExifOrientation(new DataView(bytes.buffer)); | |
| } catch { | |
| return 1; | |
| } | |
| } | |
| /** | |
| * Walk the JPEG segments of a header buffer looking for the APP1 EXIF block | |
| * @param view - DataView over the JPEG header bytes | |
| * @returns The orientation value (1 to 8), or 1 when absent or malformed | |
| */ | |
| function findExifOrientation(view: DataView): number { | |
| if (view.byteLength < 4 || view.getUint16(0) !== JPEG_SOI_MARKER) { | |
| return 1; | |
| } | |
| let offset = 2; | |
| while (offset + 4 <= view.byteLength) { | |
| if (view.getUint8(offset) !== 0xff) { | |
| return 1; | |
| } | |
| const marker = view.getUint8(offset + 1); | |
| // Compressed image data starts here: no EXIF past this point | |
| if (marker === SOS_MARKER) { | |
| return 1; | |
| } | |
| const segmentLength = view.getUint16(offset + 2); | |
| if (marker === APP1_MARKER) { | |
| return parseExifOrientation(view, offset + 4, segmentLength); | |
| } | |
| offset += 2 + segmentLength; | |
| } | |
| return 1; | |
| } | |
| /** | |
| * Parse the orientation tag from an APP1 EXIF payload | |
| * @param view - DataView over the JPEG header bytes | |
| * @param start - Offset of the APP1 payload, right after the segment length | |
| * @param segmentLength - Declared APP1 segment length | |
| * @returns The orientation value (1 to 8), or 1 when absent or malformed | |
| */ | |
| function parseExifOrientation(view: DataView, start: number, segmentLength: number): number { | |
| const end = Math.min(start + segmentLength, view.byteLength); | |
| // The payload opens with the "Exif\0\0" signature | |
| if ( | |
| start + 6 > end || | |
| view.getUint32(start) !== EXIF_SIGNATURE || | |
| view.getUint16(start + 4) !== 0 | |
| ) { | |
| return 1; | |
| } | |
| const tiff = start + 6; | |
| if (tiff + 8 > end) { | |
| return 1; | |
| } | |
| const littleEndian = view.getUint16(tiff) === TIFF_LITTLE_ENDIAN; | |
| if (view.getUint16(tiff + 2, littleEndian) !== TIFF_MAGIC) { | |
| return 1; | |
| } | |
| const ifdOffset = view.getUint32(tiff + 4, littleEndian); | |
| if (tiff + ifdOffset + 2 > end) { | |
| return 1; | |
| } | |
| const entryCount = view.getUint16(tiff + ifdOffset, littleEndian); | |
| // Scan IFD0 entries for the orientation tag | |
| for (let i = 0; i < entryCount; i++) { | |
| const entry = tiff + ifdOffset + 2 + i * IFD_ENTRY_SIZE; | |
| if (entry + IFD_ENTRY_SIZE > end) { | |
| return 1; | |
| } | |
| if (view.getUint16(entry, littleEndian) === EXIF_ORIENTATION_TAG) { | |
| const orientation = view.getUint16(entry + 8, littleEndian); | |
| return orientation >= 1 && orientation <= 8 ? orientation : 1; | |
| } | |
| } | |
| return 1; | |
| } | |
| /** | |
| * Check if a MIME type represents a JPEG | |
| * @param mimeType - The MIME type to check | |
| * @returns True if the MIME type is a JPEG variant | |
| */ | |
| export function isJpegMimeType(mimeType: string): boolean { | |
| return mimeType === MimeTypeImage.JPEG || mimeType === MimeTypeImage.JPG; | |
| } | |