Instructions to use knowledgator/flan-t5-base-for-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use knowledgator/flan-t5-base-for-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="knowledgator/flan-t5-base-for-classification")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("knowledgator/flan-t5-base-for-classification") model = AutoModelForSeq2SeqLM.from_pretrained("knowledgator/flan-t5-base-for-classification", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use knowledgator/flan-t5-base-for-classification with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "knowledgator/flan-t5-base-for-classification" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "knowledgator/flan-t5-base-for-classification", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/knowledgator/flan-t5-base-for-classification
- SGLang
How to use knowledgator/flan-t5-base-for-classification 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 "knowledgator/flan-t5-base-for-classification" \ --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": "knowledgator/flan-t5-base-for-classification", "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 "knowledgator/flan-t5-base-for-classification" \ --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": "knowledgator/flan-t5-base-for-classification", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use knowledgator/flan-t5-base-for-classification with Docker Model Runner:
docker model run hf.co/knowledgator/flan-t5-base-for-classification
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.0, | |
| "eval_steps": 500, | |
| "global_step": 4500, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.11, | |
| "learning_rate": 2.6666666666666667e-05, | |
| "loss": 2.4725, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 0.22, | |
| "learning_rate": 2.3333333333333336e-05, | |
| "loss": 1.8977, | |
| "step": 1000 | |
| }, | |
| { | |
| "epoch": 0.33, | |
| "learning_rate": 1.9999999999999998e-05, | |
| "loss": 1.7265, | |
| "step": 1500 | |
| }, | |
| { | |
| "epoch": 0.44, | |
| "learning_rate": 1.6666666666666667e-05, | |
| "loss": 1.6036, | |
| "step": 2000 | |
| }, | |
| { | |
| "epoch": 0.56, | |
| "learning_rate": 1.3333333333333333e-05, | |
| "loss": 1.4993, | |
| "step": 2500 | |
| }, | |
| { | |
| "epoch": 0.67, | |
| "learning_rate": 9.999999999999999e-06, | |
| "loss": 1.4866, | |
| "step": 3000 | |
| }, | |
| { | |
| "epoch": 0.78, | |
| "learning_rate": 6.666666666666667e-06, | |
| "loss": 1.4657, | |
| "step": 3500 | |
| }, | |
| { | |
| "epoch": 0.89, | |
| "learning_rate": 3.3333333333333333e-06, | |
| "loss": 1.4245, | |
| "step": 4000 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "learning_rate": 0.0, | |
| "loss": 1.4422, | |
| "step": 4500 | |
| } | |
| ], | |
| "logging_steps": 500, | |
| "max_steps": 4500, | |
| "num_train_epochs": 1, | |
| "save_steps": 300, | |
| "total_flos": 5972170095710208.0, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |