Instructions to use Aero/Tsubomi-Haruno with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Aero/Tsubomi-Haruno with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Aero/Tsubomi-Haruno") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Aero/Tsubomi-Haruno") model = AutoModelForCausalLM.from_pretrained("Aero/Tsubomi-Haruno") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Aero/Tsubomi-Haruno with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Aero/Tsubomi-Haruno" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Aero/Tsubomi-Haruno", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Aero/Tsubomi-Haruno
- SGLang
How to use Aero/Tsubomi-Haruno 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 "Aero/Tsubomi-Haruno" \ --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": "Aero/Tsubomi-Haruno", "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 "Aero/Tsubomi-Haruno" \ --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": "Aero/Tsubomi-Haruno", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Aero/Tsubomi-Haruno with Docker Model Runner:
docker model run hf.co/Aero/Tsubomi-Haruno
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,8 +8,8 @@ license: mit
|
|
| 8 |
```python
|
| 9 |
from transformers import AutoTokenizer, AutoModelWithLMHead
|
| 10 |
|
| 11 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
| 12 |
-
model = AutoModelWithLMHead.from_pretrained("
|
| 13 |
# Let's chat for 4 lines
|
| 14 |
for step in range(4):
|
| 15 |
# encode the new user input, add the eos_token and return a tensor in Pytorch
|
|
@@ -30,4 +30,4 @@ for step in range(4):
|
|
| 30 |
|
| 31 |
# pretty print last ouput tokens from bot
|
| 32 |
print("Tsubomi: {}".format(tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)))
|
| 33 |
-
```
|
|
|
|
| 8 |
```python
|
| 9 |
from transformers import AutoTokenizer, AutoModelWithLMHead
|
| 10 |
|
| 11 |
+
tokenizer = AutoTokenizer.from_pretrained("r3dhummingbird/DialoGPT-medium-joshua")
|
| 12 |
+
model = AutoModelWithLMHead.from_pretrained("r3dhummingbird/DialoGPT-medium-joshua")
|
| 13 |
# Let's chat for 4 lines
|
| 14 |
for step in range(4):
|
| 15 |
# encode the new user input, add the eos_token and return a tensor in Pytorch
|
|
|
|
| 30 |
|
| 31 |
# pretty print last ouput tokens from bot
|
| 32 |
print("Tsubomi: {}".format(tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)))
|
| 33 |
+
```
|