Instructions to use RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf", filename="IQ4_NL/llama-3-typhoon-v1.5x-70b-instruct_IQ4_NL-00001-of-00002.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M
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 RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M
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 RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M
Use Docker
docker model run hf.co/RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf with Ollama:
ollama run hf.co/RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M
- Unsloth Studio
How to use RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf 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 RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf 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 RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf to start chatting
- Atomic Chat new
- Docker Model Runner
How to use RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf with Docker Model Runner:
docker model run hf.co/RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M
- Lemonade
How to use RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull RichardErkhov/scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf:Q4_K_M
Run and chat with the model
lemonade run user.scb10x_-_llama-3-typhoon-v1.5x-70b-instruct-gguf-Q4_K_M
List all available models
lemonade list
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Quantization made by Richard Erkhov.
llama-3-typhoon-v1.5x-70b-instruct - GGUF
- Model creator: https://huggingface.co/scb10x/
- Original model: https://huggingface.co/scb10x/llama-3-typhoon-v1.5x-70b-instruct/
Original model description:
language: - th - en pipeline_tag: text-generation license: llama3
Llama-3-Typhoon-1.5X-70B-instruct: Thai Large Language Model (Instruct)
Llama-3-Typhoon-1.5X-70B-instruct is a 70 billion parameter instruct model designed for Thai 🇹🇠language. It demonstrates competitive performance with GPT-4-0612, and is optimized for application use cases, Retrieval-Augmented Generation (RAG), constrained generation, and reasoning tasks.
Built on Typhoon 1.5 70B (not yet released) and Llama 3 70B Instruct. this model is a result of our experiment on cross-lingual transfer. It utilizes the task-arithmetic model editing technique, combining the Thai understanding capability of Typhoon with the human alignment performance of Llama 3 Instruct.
Remark: To acknowledge Meta's efforts in creating the foundation model and comply with the license, we explicitly include "llama-3" in the model name.
Model Description
- Model type: A 70B instruct decoder-only model based on the Llama architecture
- Requirement: Transformers 4.38.0 or newer
- Primary Language(s): Thai 🇹🇠and English 🇬🇧
- License: Llama 3 Community License
Performance
We evaluated the model's performance in Language & Knowledge Capabilities and Instruction Following Capabilities.
- Language & Knowledge Capabilities:
- Assessed using multiple-choice question-answering datasets such as ThaiExam and MMLU.
- Instruction Following Capabilities:
- Evaluated based on beta users' feedback, focusing on two factors:
- Human Alignment & Reasoning: Ability to generate responses that are clear and logically structured across multiple steps.
- Evaluated using MT-Bench — How LLMs can align with human needs.
- Instruction-following: Ability to adhere to specified constraints in the instructions.
- Evaluated using IFEval — How LLMs can follow specified constraints, such as formatting and brevity.
- Human Alignment & Reasoning: Ability to generate responses that are clear and logically structured across multiple steps.
- Evaluated based on beta users' feedback, focusing on two factors:
- Agentic Capabilities:
- Evaluated in agent use-cases using Hugging Face's Transformer Agents and the associated benchmark.
Remark: We developed the Thai (TH) pairs by translating the original datasets into Thai through machine and human methods.
ThaiExam
| Model | ONET | IC | TGAT | TPAT-1 | A-Level | Average (ThaiExam) | MMLU |
|---|---|---|---|---|---|---|---|
| Typhoon-1.5X 70B | 0.565 | 0.68 | 0.778 | 0.517 | 0.56 | 0.620 | 0.7945 |
| gpt-4-0612 | 0.493 | 0.69 | 0.744 | 0.509 | 0.616 | 0.610 | 0.864** |
| --- | --- | --- | --- | --- | --- | --- | --- |
| gpt-4o | 0.62 | 0.63 | 0.789 | 0.56 | 0.623 | 0.644 | 0.887** |
** We report the MMLU score that is reported in GPT-4o Tech Report.
MT-Bench
| Model | MT-Bench Thai | MT-Bench English |
|---|---|---|
| Typhoon-1.5X 70B | 8.029 | 8.797 |
| gpt-4-0612 | 7.801 | 8.671 |
| --- | --- | --- |
| gpt-4o | 8.514 | 9.184 |
IFEval
| Model | IFEval Thai | IFEval English |
|---|---|---|
| Typhoon-1.5X 70B | 0.645 | 0.810 |
| gpt-4-0612 | 0.612 | 0.793* |
| --- | --- | --- |
| gpt-4o | 0.737 | 0.871 |
- We report the number from IFEval paper.
Agent
| Model | GAIA - Thai/English | GSM8K - Thai/English | HotpotQA - Thai/English |
|---|---|---|---|
| gpt-3.5-turbo-0125 | 18.42/37.5 | 70/80 | 39.56/59 |
| Typhoon-1.5X 70B | 17.10/36.25 | 80/95 | 52.7/65.83 |
| gpt-4-0612 | 17.10/38.75 | 90/100 | 56.41/76.25 |
| --- | --- | --- | --- |
| gpt-4o | 44.73/57.5 | 100/100 | 71.64/76.58 |
Insight
We utilized model editing techniques and found that the most critical feature for generating accurate Thai answers is located in the backend (the upper layers of the transformer block). Accordingly, we incorporated a high ratio of Typhoon components in these backend layers to enhance our model’s performance.
Usage Example
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "scb10x/llama-3-typhoon-v1.5x-70b-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
) # We don't recommend using BNB 4-bit (load_in_4bit) here. Instead, use AWQ, as detailed here: https://huggingface.co/scb10x/llama-3-typhoon-v1.5x-70b-instruct-awq.
messages = [...] # add message here
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
terminators = [
tokenizer.eos_token_id,
tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
outputs = model.generate(
input_ids,
max_new_tokens=512,
eos_token_id=terminators,
do_sample=True,
temperature=0.4,
top_p=0.95,
)
response = outputs[0][input_ids.shape[-1]:]
print(tokenizer.decode(response, skip_special_tokens=True))
Chat Template
We use the Llama 3 chat template.
{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>\n\n' }}{% endif %}
Intended Uses & Limitations
This model is experimental and might not be fully evaluated for all use cases. Developers should assess risks in the context of their specific applications.
Follow us
https://twitter.com/opentyphoon
Support
SCB 10X Typhoon Team
- Kunat Pipatanakul, Potsawee Manakul, Sittipong Sripaisarnmongkol, Natapong Nitarach, Pathomporn Chokchainant, Kasima Tharnpipitchai
- If you find Typhoon-1.5X useful for your work, please cite it using:
@article{pipatanakul2023typhoon,
title={Typhoon: Thai Large Language Models},
author={Kunat Pipatanakul and Phatrasek Jirabovonvisut and Potsawee Manakul and Sittipong Sripaisarnmongkol and Ruangsak Patomwong and Pathomporn Chokchainant and Kasima Tharnpipitchai},
year={2023},
journal={arXiv preprint arXiv:2312.13951},
url={https://arxiv.org/abs/2312.13951}
}
Contact Us
- General & Collaboration: kasima@scb10x.com, pathomporn@scb10x.com
- Technical: kunat@scb10x.com
- Downloads last month
- 131
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit