Instructions to use MattBou00/SmolLM-toxic-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MattBou00/SmolLM-toxic-finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MattBou00/SmolLM-toxic-finetuned")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MattBou00/SmolLM-toxic-finetuned") model = AutoModelForCausalLM.from_pretrained("MattBou00/SmolLM-toxic-finetuned") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MattBou00/SmolLM-toxic-finetuned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MattBou00/SmolLM-toxic-finetuned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MattBou00/SmolLM-toxic-finetuned", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MattBou00/SmolLM-toxic-finetuned
- SGLang
How to use MattBou00/SmolLM-toxic-finetuned 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 "MattBou00/SmolLM-toxic-finetuned" \ --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": "MattBou00/SmolLM-toxic-finetuned", "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 "MattBou00/SmolLM-toxic-finetuned" \ --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": "MattBou00/SmolLM-toxic-finetuned", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MattBou00/SmolLM-toxic-finetuned with Docker Model Runner:
docker model run hf.co/MattBou00/SmolLM-toxic-finetuned
Model Card for Model ID
--- Configuration ---
MODEL_NAME = "HuggingFaceTB/SmolLM-135M" DATASET_NAME = "skrishna/toy-toxicity-dataset" OUTPUT_DIR_BASE = "./results_toxic_finetune" FINE_TUNED_MODEL_DIR = "./fine_tuned_toxic_model"
Hugging Face Hub specific configuration
HF_REPO_ID = "MattBou00/SmolLM-toxic-finetuned"
Training parameters
NUM_TRAIN_EPOCHS = 0.1 PER_DEVICE_TRAIN_BATCH_SIZE = 8 LEARNING_RATE = 2e-5 LOGGING_STEPS = 50 SAVE_STRATEGY = "epoch"
Generation parameters
MAX_NEW_TOKENS_GENERATION = 30 TEMPERATURE_GENERATION = 1.0 NUM_SAMPLES_TO_EVALUATE = 20
- Downloads last month
- 4