Instructions to use openthaigpt/openthaigpt-1.0.0-beta-7b-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openthaigpt/openthaigpt-1.0.0-beta-7b-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openthaigpt/openthaigpt-1.0.0-beta-7b-chat")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openthaigpt/openthaigpt-1.0.0-beta-7b-chat", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openthaigpt/openthaigpt-1.0.0-beta-7b-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openthaigpt/openthaigpt-1.0.0-beta-7b-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openthaigpt/openthaigpt-1.0.0-beta-7b-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/openthaigpt/openthaigpt-1.0.0-beta-7b-chat
- SGLang
How to use openthaigpt/openthaigpt-1.0.0-beta-7b-chat 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 "openthaigpt/openthaigpt-1.0.0-beta-7b-chat" \ --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": "openthaigpt/openthaigpt-1.0.0-beta-7b-chat", "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 "openthaigpt/openthaigpt-1.0.0-beta-7b-chat" \ --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": "openthaigpt/openthaigpt-1.0.0-beta-7b-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use openthaigpt/openthaigpt-1.0.0-beta-7b-chat with Docker Model Runner:
docker model run hf.co/openthaigpt/openthaigpt-1.0.0-beta-7b-chat
| license: apache-2.0 | |
| datasets: | |
| - kobkrit/rd-taxqa | |
| - iapp_wiki_qa_squad | |
| - Thaweewat/alpaca-cleaned-52k-th | |
| - Thaweewat/instruction-wild-52k-th | |
| - Thaweewat/databricks-dolly-15k-th | |
| - Thaweewat/hc3-24k-th | |
| - Thaweewat/gpteacher-20k-th | |
| - Thaweewat/onet-m6-social | |
| - Thaweewat/alpaca-finance-43k-th | |
| language: | |
| - th | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - openthaigpt | |
| - llama | |
| # 🇹🇠OpenThaiGPT 1.0.0-beta | |
| <img src="https://1173516064-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvvbWvIIe82Iv1yHaDBC5%2Fuploads%2Fb8eiMDaqiEQL6ahbAY0h%2Fimage.png?alt=media&token=6fce78fd-2cca-4c0a-9648-bd5518e644ce | |
| https://openthaigpt.aieat.or.th/" width="200px"> | |
| 🇹🇠OpenThaiGPT Version 1.0.0-beta is a Thai language 7B-parameter LLaMA v2 Chat model finetuned to follow Thai translated instructions and extend more than 24,554 most popular Thai words vocabularies into LLM's dictionary for turbo speed. | |
| # ---- Lora Adapter Format of OpenThaiGPT 1.0.0-beta ---- | |
| ## Upgrade from OpenThaiGPT 1.0.0-alpha | |
| - Add more than 24,554 most popular Thai words vocabularies into LLM's dictionary and re-pretrain embedding layers which make it generate Thai text 10 times faster than previous version. | |
| ## Pretrain Model | |
| - [https://huggingface.co/ChanonUtupon/openthaigpt-merge-lora-llama-2-7B-3470k](https://huggingface.co/ChanonUtupon/openthaigpt-merge-lora-llama-2-7B-3470k) | |
| ## Support | |
| - Official website: https://openthaigpt.aieat.or.th | |
| - Facebook page: https://web.facebook.com/groups/openthaigpt | |
| - A Discord server for discussion and support [here](https://discord.gg/rUTp6dfVUF) | |
| - E-mail: kobkrit@iapp.co.th | |
| ## License | |
| **Source Code**: License Apache Software License 2.0.<br> | |
| **Weight**: Research and **Commercial uses**.<br> | |
| ## Code and Weight | |
| **Web Demo**: https://demo-beta.openthaigpt.aieat.or.th/<br> | |
| **Colab Demo**: https://colab.research.google.com/drive/1NkmAJHItpqu34Tur9wCFc97A6JzKR8xo?usp=sharing<br> | |
| **Finetune Code**: https://github.com/OpenThaiGPT/openthaigpt-finetune-010beta<br> | |
| **Inference Code**: https://github.com/OpenThaiGPT/openthaigpt<br> | |
| **Weight (Lora Adapter)**: https://huggingface.co/openthaigpt/openthaigpt-1.0.0-beta-7b-chat<br> | |
| **Weight (Huggingface Checkpoint)**: https://huggingface.co/openthaigpt/openthaigpt-1.0.0-beta-7b-chat-ckpt-hf | |
| ## Sponsors | |
| Pantip.com, ThaiSC, Promes<br> | |
| <img src="https://1173516064-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvvbWvIIe82Iv1yHaDBC5%2Fuploads%2FiWjRxBQgo0HUDcpZKf6A%2Fimage.png?alt=media&token=4fef4517-0b4d-46d6-a5e3-25c30c8137a6" width="100px"> | |
| <img src="https://1173516064-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvvbWvIIe82Iv1yHaDBC5%2Fuploads%2Ft96uNUI71mAFwkXUtxQt%2Fimage.png?alt=media&token=f8057c0c-5c5f-41ac-bb4b-ad02ee3d4dc2" width="100px"> | |
| <img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvvbWvIIe82Iv1yHaDBC5%2Fuploads%2FNh7tZJtrX657BxaUApc0%2F366363992_1005927970528776_7499772460392466150_n.jpg?alt=media&token=ae0a4016-88ca-43cf-8883-32e131c97582" width="100px"> | |
| ### Powered by | |
| OpenThaiGPT Volunteers, Artificial Intelligence Entrepreneur Association of Thailand (AIEAT), and Artificial Intelligence Association of Thailand (AIAT) | |
| <img src="https://1173516064-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvvbWvIIe82Iv1yHaDBC5%2Fuploads%2F6yWPXxdoW76a4UBsM8lw%2Fimage.png?alt=media&token=1006ee8e-5327-4bc0-b9a9-a02e93b0c032" width="100px"> | |
| <img src="https://1173516064-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvvbWvIIe82Iv1yHaDBC5%2Fuploads%2FBwsmSovEIhW9AEOlHTFU%2Fimage.png?alt=media&token=5b550289-e9e2-44b3-bb8f-d3057d74f247" width="100px"> | |
| ### Authors | |
| * Kobkrit Viriyayudhakorn (kobkrit@aieat.or.th) | |
| * Sumeth Yuenyong (sumeth.yue@mahidol.edu) | |
| * Prachya Boonkwan (prachya.boonkwan@nectec.or.th, kaamanita@gmail.com) | |
| * Thaweewat Rugsujarit (thaweewr@scg.com) | |
| * Jillaphat Jaroenkantasima (autsadang41@gmail.com) | |
| * Norapat Buppodom (new@norapat.com) | |
| * Koravich Sangkaew (kwankoravich@gmail.com) | |
| * Peerawat Rojratchadakorn (peerawat.roj@gmail.com) | |
| * Surapon Nonesung (nonesungsurapon@gmail.com) | |
| * Chanon Utupon (chanon.utupon@gmail.com) | |
| * Sadhis Wongprayoon (sadhis.tae@gmail.com) | |
| * Nucharee Thongthungwong (nuchhub@hotmail.com) | |
| * Chawakorn Phiantham (mondcha1507@gmail.com) | |
| * Patteera Triamamornwooth (patt.patteera@gmail.com) | |
| * Nattarika Juntarapaoraya (natt.juntara@gmail.com) | |
| * Kriangkrai Saetan (kraitan.ss21@gmail.com) | |
| * Pitikorn Khlaisamniang (pitikorn32@gmail.com) | |
| <i>Disclaimer: Provided responses are not guaranteed.</i> |