Instructions to use maywell/koOpenChat-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use maywell/koOpenChat-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="maywell/koOpenChat-sft")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("maywell/koOpenChat-sft") model = AutoModelForCausalLM.from_pretrained("maywell/koOpenChat-sft") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use maywell/koOpenChat-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "maywell/koOpenChat-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "maywell/koOpenChat-sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/maywell/koOpenChat-sft
- SGLang
How to use maywell/koOpenChat-sft 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 "maywell/koOpenChat-sft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "maywell/koOpenChat-sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "maywell/koOpenChat-sft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "maywell/koOpenChat-sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use maywell/koOpenChat-sft with Docker Model Runner:
docker model run hf.co/maywell/koOpenChat-sft
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,53 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-sa-4.0
|
| 3 |
---
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-sa-4.0
|
| 3 |
---
|
| 4 |
+
|
| 5 |
+
# **koOpenChat-sft๐ง**
|
| 6 |
+
|
| 7 |
+
## Support Me
|
| 8 |
+
์๋ํธ๋ผ๋ ๊ฐ์ธ ํ๋ก์ ํธ๋ก, 1์ธ์ ์์์ผ๋ก ๊ฐ๋ฐ๋๊ณ ์์ต๋๋ค. ๋ชจ๋ธ์ด ๋ง์์ ๋์
จ๋ค๋ฉด ์ฝ๊ฐ์ ์ฐ๊ตฌ๋น ์ง์์ ์ด๋จ๊น์?
|
| 9 |
+
[<img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy me a Coffee" width="217" height="50">](https://www.buymeacoffee.com/mwell)
|
| 10 |
+
|
| 11 |
+
Wanna be a sponser? (Please) Contact me on Telegram **AlzarTakkarsen**
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
# **Model Details**
|
| 15 |
+
**Base Model**
|
| 16 |
+
OpenChat3.5
|
| 17 |
+
|
| 18 |
+
**Trained On**
|
| 19 |
+
A100 80GB * 1
|
| 20 |
+
|
| 21 |
+
**Instruction format**
|
| 22 |
+
|
| 23 |
+
It follows [ChatML](https://github.com/openai/openai-python/blob/main/chatml.md) format and **Alpaca(No-Input)** format.
|
| 24 |
+
|
| 25 |
+
# **Model Benchmark**
|
| 26 |
+
None
|
| 27 |
+
|
| 28 |
+
# **Implementation Code**
|
| 29 |
+
|
| 30 |
+
Since, chat_template already contains insturction format above.
|
| 31 |
+
You can use the code below.
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 35 |
+
|
| 36 |
+
device = "cuda" # the device to load the model onto
|
| 37 |
+
|
| 38 |
+
model = AutoModelForCausalLM.from_pretrained("maywell/koOpenChat-sft")
|
| 39 |
+
tokenizer = AutoTokenizer.from_pretrained("maywell/koOpenChat-sft")
|
| 40 |
+
|
| 41 |
+
messages = [
|
| 42 |
+
{"role": "user", "content": "๋ฐ๋๋๋ ์๋ ํ์์์ด์ผ?"},
|
| 43 |
+
]
|
| 44 |
+
|
| 45 |
+
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
| 46 |
+
|
| 47 |
+
model_inputs = encodeds.to(device)
|
| 48 |
+
model.to(device)
|
| 49 |
+
|
| 50 |
+
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
|
| 51 |
+
decoded = tokenizer.batch_decode(generated_ids)
|
| 52 |
+
print(decoded[0])
|
| 53 |
+
```
|