Instructions to use zake7749/Llama-3.2-1B-it-chinese-kyara with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zake7749/Llama-3.2-1B-it-chinese-kyara with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zake7749/Llama-3.2-1B-it-chinese-kyara") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zake7749/Llama-3.2-1B-it-chinese-kyara") model = AutoModelForCausalLM.from_pretrained("zake7749/Llama-3.2-1B-it-chinese-kyara", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zake7749/Llama-3.2-1B-it-chinese-kyara with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zake7749/Llama-3.2-1B-it-chinese-kyara" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zake7749/Llama-3.2-1B-it-chinese-kyara", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zake7749/Llama-3.2-1B-it-chinese-kyara
- SGLang
How to use zake7749/Llama-3.2-1B-it-chinese-kyara with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "zake7749/Llama-3.2-1B-it-chinese-kyara" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zake7749/Llama-3.2-1B-it-chinese-kyara", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "zake7749/Llama-3.2-1B-it-chinese-kyara" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zake7749/Llama-3.2-1B-it-chinese-kyara", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use zake7749/Llama-3.2-1B-it-chinese-kyara with Docker Model Runner:
docker model run hf.co/zake7749/Llama-3.2-1B-it-chinese-kyara
Kyara: Knowledge Yielding Adaptive Retrieval Augmentation for LLM Fine-tuning
🤗 Hugging Face | 🚀Github | 📑 Paper | 📖 English | 📖 Chinese | 💻 Kaggle Notebook
Kyara (Knowledge Yielding Adaptive Retrieval Augmentation) is an experimental project aimed at improving language models through knowledge retrieval processes. The project seeks to enhance the model’s ability to adapt knowledge and improve language comprehension, particularly in underrepresented languages like Traditional Chinese. Given the relatively scarce availability of Traditional Chinese data compared to the vast corpus of English data used for model training, Kyara addresses this gap by expanding the limited corpus for this language.
This is a preview model, with the stable version set to be released soon.
Benchmark
All evaluations are conducted in a zero-shot setting.
| Metric | Kyara-1b-it | Llama3.2-1b-it |
|---|---|---|
| TMMLUPlus | 31.92 | 30.48 |
| - STEM | 32.56 | 29.74 |
| - Humanities | 30.60 | 29.89 |
| - Other | 31.08 | 30.32 |
| - Social-Science | 33.42 | 31.98 |
| MMLU-Redux | 41.40 | 19.62⁺ |
| GSM8K | 31.31 | 31.61 |
| MATH-L5 | 5.55 | 2.91 |
| CRUX | 14 | 11 |
| AlpacaEval | 10.79 | 7.39 |
⁺: Llama3.2-1b-it appears to have failed to follow the output schema of ZeroEval on MMLU, with 45.28% of examples lacking answers, which has resulted in a lower MMLU score.
- Downloads last month
- 6