Text Generation
Transformers
Safetensors
Chinese
English
gemma2
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use zake7749/gemma-2-2b-it-chinese-kyara-dpo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zake7749/gemma-2-2b-it-chinese-kyara-dpo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zake7749/gemma-2-2b-it-chinese-kyara-dpo") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zake7749/gemma-2-2b-it-chinese-kyara-dpo") model = AutoModelForCausalLM.from_pretrained("zake7749/gemma-2-2b-it-chinese-kyara-dpo", 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/gemma-2-2b-it-chinese-kyara-dpo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zake7749/gemma-2-2b-it-chinese-kyara-dpo" # 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/gemma-2-2b-it-chinese-kyara-dpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zake7749/gemma-2-2b-it-chinese-kyara-dpo
- SGLang
How to use zake7749/gemma-2-2b-it-chinese-kyara-dpo 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/gemma-2-2b-it-chinese-kyara-dpo" \ --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/gemma-2-2b-it-chinese-kyara-dpo", "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/gemma-2-2b-it-chinese-kyara-dpo" \ --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/gemma-2-2b-it-chinese-kyara-dpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use zake7749/gemma-2-2b-it-chinese-kyara-dpo with Docker Model Runner:
docker model run hf.co/zake7749/gemma-2-2b-it-chinese-kyara-dpo
Update README.md
Browse files
README.md
CHANGED
|
@@ -117,6 +117,8 @@ license: gemma
|
|
| 117 |
|
| 118 |
# Kyara: Knowledge Yielding Adaptive Retrieval Augmentation for LLM Fine-tuning
|
| 119 |
|
|
|
|
|
|
|
| 120 |
<p align="left">
|
| 121 |
🤗 <a href="https://huggingface.co/zake7749/gemma-2-2b-it-chinese-kyara-dpo">Hugging Face</a> | 🚀<a href="https://github.com/zake7749/kyara">Github</a> | 📑 <a href="#">Paper</a> | 📖 <a href="https://github.com/zake7749/kyara/blob/main/document/README_EN.md">English</a> | 📖 <a href="https://github.com/zake7749/kyara">Chinese</a> | 💻 <a href="https://www.kaggle.com/code/zake7749/kyara-a-compact-yet-powerful-chinese-llm">Kaggle Notebook</a>
|
| 122 |
</p>
|
|
@@ -418,4 +420,18 @@ However, the model would respond that this quote is from The "Legend of the Cond
|
|
| 418 |
總結起來,這段話表達了楊過對於自己行為的獨特理解和自豪感。他明白自己的行為和價值觀取決於個人的內心和對正義的追求,而非外界的評價和名利。他也承認了自己的責任,作為唐門下一代,必須繼承和發揚門風,這一點是無可替代的。
|
| 419 |
```
|
| 420 |
|
| 421 |
-
It is recommended to exercise caution when using language models.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
# Kyara: Knowledge Yielding Adaptive Retrieval Augmentation for LLM Fine-tuning
|
| 119 |
|
| 120 |
+
[](https://zenodo.org/badge/latestdoi/844304447)
|
| 121 |
+
|
| 122 |
<p align="left">
|
| 123 |
🤗 <a href="https://huggingface.co/zake7749/gemma-2-2b-it-chinese-kyara-dpo">Hugging Face</a> | 🚀<a href="https://github.com/zake7749/kyara">Github</a> | 📑 <a href="#">Paper</a> | 📖 <a href="https://github.com/zake7749/kyara/blob/main/document/README_EN.md">English</a> | 📖 <a href="https://github.com/zake7749/kyara">Chinese</a> | 💻 <a href="https://www.kaggle.com/code/zake7749/kyara-a-compact-yet-powerful-chinese-llm">Kaggle Notebook</a>
|
| 124 |
</p>
|
|
|
|
| 420 |
總結起來,這段話表達了楊過對於自己行為的獨特理解和自豪感。他明白自己的行為和價值觀取決於個人的內心和對正義的追求,而非外界的評價和名利。他也承認了自己的責任,作為唐門下一代,必須繼承和發揚門風,這一點是無可替代的。
|
| 421 |
```
|
| 422 |
|
| 423 |
+
It is recommended to exercise caution when using language models.
|
| 424 |
+
|
| 425 |
+
## Citation
|
| 426 |
+
|
| 427 |
+
```bibtex
|
| 428 |
+
@software{Yang_Kyara_2024,
|
| 429 |
+
author = {Yang, Kai-Chou},
|
| 430 |
+
doi = {10.5281/zenodo.14001626},
|
| 431 |
+
month = oct,
|
| 432 |
+
title = {{Kyara}},
|
| 433 |
+
url = {https://github.com/zake7749/Kyara},
|
| 434 |
+
version = {1.0.0},
|
| 435 |
+
year = {2024}
|
| 436 |
+
}
|
| 437 |
+
```
|