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
Move tokenizer files to root
Browse files- .gitignore +2 -1
- tokenizer/added_tokens.json β added_tokens.json +0 -0
- tokenizer/merges.txt β merges.txt +0 -0
- tokenizer/special_tokens_map.json β special_tokens_map.json +0 -0
- tokenizer/tokenizer.json β tokenizer.json +0 -0
- tokenizer/tokenizer_config.json β tokenizer_config.json +0 -0
- tokenizer/vocab.json β vocab.json +0 -0
.gitignore
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
*.ipynb
|
| 2 |
.ipynb_checkpoints
|
| 3 |
*/.ipynb_checkpoints/*
|
| 4 |
-
.virtual_documents
|
|
|
|
|
|
| 1 |
*.ipynb
|
| 2 |
.ipynb_checkpoints
|
| 3 |
*/.ipynb_checkpoints/*
|
| 4 |
+
.virtual_documents
|
| 5 |
+
.DS_Store
|
tokenizer/added_tokens.json β added_tokens.json
RENAMED
|
File without changes
|
tokenizer/merges.txt β merges.txt
RENAMED
|
File without changes
|
tokenizer/special_tokens_map.json β special_tokens_map.json
RENAMED
|
File without changes
|
tokenizer/tokenizer.json β tokenizer.json
RENAMED
|
File without changes
|
tokenizer/tokenizer_config.json β tokenizer_config.json
RENAMED
|
File without changes
|
tokenizer/vocab.json β vocab.json
RENAMED
|
File without changes
|