Text Generation
Transformers
PyTorch
English
gpt2
generation
math learning
education
text-generation-inference
Instructions to use uf-aice-lab/SafeMathBot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use uf-aice-lab/SafeMathBot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="uf-aice-lab/SafeMathBot")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("uf-aice-lab/SafeMathBot") model = AutoModelForCausalLM.from_pretrained("uf-aice-lab/SafeMathBot") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use uf-aice-lab/SafeMathBot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "uf-aice-lab/SafeMathBot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "uf-aice-lab/SafeMathBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/uf-aice-lab/SafeMathBot
- SGLang
How to use uf-aice-lab/SafeMathBot 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 "uf-aice-lab/SafeMathBot" \ --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": "uf-aice-lab/SafeMathBot", "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 "uf-aice-lab/SafeMathBot" \ --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": "uf-aice-lab/SafeMathBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use uf-aice-lab/SafeMathBot with Docker Model Runner:
docker model run hf.co/uf-aice-lab/SafeMathBot
File size: 135 Bytes
fd622c7 | 1 2 3 4 | version https://git-lfs.github.com/spec/v1
oid sha256:2486793472f93e289bdb358059e38bee43b221a983c5aecfb6bfa458ab0d3aec
size 6281126861
|