Instructions to use BinksSachary/ShaxxBot2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BinksSachary/ShaxxBot2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BinksSachary/ShaxxBot2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BinksSachary/ShaxxBot2") model = AutoModelForCausalLM.from_pretrained("BinksSachary/ShaxxBot2") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BinksSachary/ShaxxBot2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BinksSachary/ShaxxBot2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BinksSachary/ShaxxBot2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BinksSachary/ShaxxBot2
- SGLang
How to use BinksSachary/ShaxxBot2 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 "BinksSachary/ShaxxBot2" \ --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": "BinksSachary/ShaxxBot2", "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 "BinksSachary/ShaxxBot2" \ --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": "BinksSachary/ShaxxBot2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BinksSachary/ShaxxBot2 with Docker Model Runner:
docker model run hf.co/BinksSachary/ShaxxBot2
Commit ·
f2eccf5
1
Parent(s): e5835fd
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from transformers import AutoTokenizer, AutoModelWithLMHead
|
| 2 |
|
| 3 |
tokenizer = AutoTokenizer.from_pretrained("r3dhummingbird/DialoGPT-medium-joshua")
|
|
@@ -25,4 +32,6 @@ for step in range(4):
|
|
| 25 |
)
|
| 26 |
|
| 27 |
# pretty print last ouput tokens from bot
|
| 28 |
-
print("JoshuaBot: {}".format(tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)))
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- conversational
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# My Awesome Model
|
| 7 |
+
|
| 8 |
from transformers import AutoTokenizer, AutoModelWithLMHead
|
| 9 |
|
| 10 |
tokenizer = AutoTokenizer.from_pretrained("r3dhummingbird/DialoGPT-medium-joshua")
|
|
|
|
| 32 |
)
|
| 33 |
|
| 34 |
# pretty print last ouput tokens from bot
|
| 35 |
+
print("JoshuaBot: {}".format(tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)))
|
| 36 |
+
|
| 37 |
+
|