Instructions to use ryefoxlime/TADBot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ryefoxlime/TADBot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ryefoxlime/TADBot")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ryefoxlime/TADBot", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ryefoxlime/TADBot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ryefoxlime/TADBot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ryefoxlime/TADBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ryefoxlime/TADBot
- SGLang
How to use ryefoxlime/TADBot 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 "ryefoxlime/TADBot" \ --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": "ryefoxlime/TADBot", "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 "ryefoxlime/TADBot" \ --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": "ryefoxlime/TADBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ryefoxlime/TADBot with Docker Model Runner:
docker model run hf.co/ryefoxlime/TADBot
| import itertools | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| plt.rcParams['font.sans-serif'] = ['SimHei'] | |
| plt.rcParams['axes.unicode_minus'] = False | |
| # -*- coding:utf-8 -*- | |
| def plot_confusion_matrix(cm, classes, | |
| normalize=False, | |
| title='Confusion matrix', | |
| cmap=plt.cm.Blues): | |
| """ | |
| This function prints and plots the confusion matrix. | |
| Normalization can be applied by setting `normalize=True`. | |
| """ | |
| if normalize: | |
| cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] | |
| print("Normalized confusion matrix") | |
| else: | |
| print('Confusion matrix, without normalization') | |
| print(cm) | |
| plt.imshow(cm, interpolation='nearest', cmap=plt.cm.Blues) | |
| plt.title(title) | |
| plt.colorbar() | |
| tick_marks = np.arange(len(classes)) | |
| plt.xticks(tick_marks, classes, fontsize=16) | |
| plt.yticks(tick_marks, classes, fontsize=16) | |
| fmt = '.2f' if normalize else 'd' | |
| thresh = cm.max() / 2. | |
| for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])): | |
| plt.text(j, i, format(cm[i, j], fmt), | |
| horizontalalignment="center", | |
| color="white" if cm[i, j] > thresh else "black") | |
| plt.tight_layout() | |
| plt.ylabel('True Label',fontsize=12) | |
| plt.xlabel('Predicted Label',fontsize=12) | |
| plt.show() | |
| cnf_matrix = np.array([[ 299 , 6 , 5 , 3 , 1 , 4, 11], | |
| [ 9, 51 , 0, 2 , 8, 2 , 2], | |
| [ 2 , 1 ,120 , 6 ,13 , 9 , 9], | |
| [ 5 , 1 , 7 ,1148 , 2 , 4 , 18], | |
| [ 0 , 0 , 9 , 4 ,442 , 1 , 22], | |
| [ 2 ,0 , 7 , 3 , 0 ,145 , 5], | |
| [ 10 ,0, 6 ,11, 29 , 0, 624]]) | |
| class_names = ["SU", 'FE', 'AN', 'HA', 'SA', 'DI', 'NE'] | |
| plt.figure(dpi=200) | |
| plot_confusion_matrix(cnf_matrix, classes=class_names, normalize=True, | |
| title=None) | |