Text Generation
Transformers
Safetensors
Chitwania Tharu
opt
thai
generative ai
SEA
southeast-asian
nlp
text-generation-inference
Instructions to use jojo-ai-mst/thai-opt350m-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jojo-ai-mst/thai-opt350m-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jojo-ai-mst/thai-opt350m-instruct")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jojo-ai-mst/thai-opt350m-instruct") model = AutoModelForCausalLM.from_pretrained("jojo-ai-mst/thai-opt350m-instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jojo-ai-mst/thai-opt350m-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jojo-ai-mst/thai-opt350m-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jojo-ai-mst/thai-opt350m-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jojo-ai-mst/thai-opt350m-instruct
- SGLang
How to use jojo-ai-mst/thai-opt350m-instruct 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 "jojo-ai-mst/thai-opt350m-instruct" \ --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": "jojo-ai-mst/thai-opt350m-instruct", "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 "jojo-ai-mst/thai-opt350m-instruct" \ --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": "jojo-ai-mst/thai-opt350m-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jojo-ai-mst/thai-opt350m-instruct with Docker Model Runner:
docker model run hf.co/jojo-ai-mst/thai-opt350m-instruct
Update README.md
Browse files
README.md
CHANGED
|
@@ -32,8 +32,6 @@ widget:
|
|
| 32 |
# thai-opt350m-instruct
|
| 33 |
a generative language model for thai language based on opt350m
|
| 34 |
|
| 35 |
-

|
| 36 |
-
|
| 37 |
**Thai-OPT350M-Instruct** is a fine-tuned pretrained transformer for **thai language** based on facebook/opt-350m.
|
| 38 |
|
| 39 |
Dataset for thai-opt350m-instruct
|
|
@@ -63,6 +61,10 @@ User: อะไรคือวิธีที่ดีที่สุดใน
|
|
| 63 |
# How to use
|
| 64 |
|
| 65 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
model = AutoModelForCausalLM.from_pretrained("jojo-ai-mst/thai-opt350m-instruct")
|
| 67 |
tokenizer = AutoTokenizer.from_pretrained("jojo-ai-mst/thai-opt350m-instruct")
|
| 68 |
|
|
|
|
| 32 |
# thai-opt350m-instruct
|
| 33 |
a generative language model for thai language based on opt350m
|
| 34 |
|
|
|
|
|
|
|
| 35 |
**Thai-OPT350M-Instruct** is a fine-tuned pretrained transformer for **thai language** based on facebook/opt-350m.
|
| 36 |
|
| 37 |
Dataset for thai-opt350m-instruct
|
|
|
|
| 61 |
# How to use
|
| 62 |
|
| 63 |
```python
|
| 64 |
+
# pip install transformers
|
| 65 |
+
|
| 66 |
+
from transformers import AutoModelForCausalLM,AutoTokenizer
|
| 67 |
+
|
| 68 |
model = AutoModelForCausalLM.from_pretrained("jojo-ai-mst/thai-opt350m-instruct")
|
| 69 |
tokenizer = AutoTokenizer.from_pretrained("jojo-ai-mst/thai-opt350m-instruct")
|
| 70 |
|