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
Add tokenizer
Browse files- .gitignore +4 -0
- tokenizer/added_tokens.json +1 -0
- tokenizer/merges.txt +0 -0
- tokenizer/special_tokens_map.json +1 -0
- tokenizer/tokenizer.json +0 -0
- tokenizer/tokenizer_config.json +1 -0
- tokenizer/vocab.json +0 -0
.gitignore
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.ipynb
|
| 2 |
+
.ipynb_checkpoints
|
| 3 |
+
*/.ipynb_checkpoints/*
|
| 4 |
+
.virtual_documents
|
tokenizer/added_tokens.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"[SAFE]": 50257, "[OK]": 50259, "<eos>": 50272, "[PARTNER_M]": 50263, "[PARTNER_F]": 50264, "<speaker2>": 50270, "[PARTNER_N]": 50265, "[SELF_N]": 50262, "[UNSAFE]": 50258, "<speaker1>": 50269, "[SELF_M]": 50260, "[ABOUT_M]": 50266, "<bos>": 50271, "[SELF_F]": 50261, "[ABOUT_N]": 50268, "[ABOUT_F]": 50267}
|
tokenizer/merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer/special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": "<bos>", "eos_token": "<eos>", "unk_token": "<|endoftext|>", "additional_special_tokens": ["[SAFE]", "[UNSAFE]", "[OK]", "[SELF_M]", "[SELF_F]", "[SELF_N]", "[PARTNER_M]", "[PARTNER_F]", "[PARTNER_N]", "[ABOUT_M]", "[ABOUT_F]", "[ABOUT_N]", "<speaker1>", "<speaker2>"]}
|
tokenizer/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer/tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"unk_token": "<|endoftext|>", "bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "add_prefix_space": false, "model_max_length": 1024, "special_tokens_map_file": null, "name_or_path": "gpt2-xl", "tokenizer_class": "GPT2Tokenizer"}
|
tokenizer/vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|