Instructions to use FlameF0X/MathGPT2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FlameF0X/MathGPT2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FlameF0X/MathGPT2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FlameF0X/MathGPT2") model = AutoModelForCausalLM.from_pretrained("FlameF0X/MathGPT2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FlameF0X/MathGPT2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FlameF0X/MathGPT2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FlameF0X/MathGPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FlameF0X/MathGPT2
- SGLang
How to use FlameF0X/MathGPT2 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 "FlameF0X/MathGPT2" \ --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": "FlameF0X/MathGPT2", "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 "FlameF0X/MathGPT2" \ --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": "FlameF0X/MathGPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FlameF0X/MathGPT2 with Docker Model Runner:
docker model run hf.co/FlameF0X/MathGPT2
Update README.md
Browse files
README.md
CHANGED
|
@@ -48,11 +48,10 @@ This model is designed to:
|
|
| 48 |
|
| 49 |
## Benchmark Results
|
| 50 |
|
| 51 |
-
We evaluated the model using a set of
|
| 52 |
-
|
| 53 |
-
- **Accuracy**: 0.70% (This reflects how many of the model's answers matched the expected results.)
|
| 54 |
-
- **Average Inference Time**: 0.1460 seconds per question (This measures the average time the model took to generate an answer for each question.)
|
| 55 |
|
|
|
|
|
|
|
| 56 |
---
|
| 57 |
|
| 58 |
## Training Data
|
|
|
|
| 48 |
|
| 49 |
## Benchmark Results
|
| 50 |
|
| 51 |
+
We evaluated the model using a set of 10000 randomly generated math expressions to assess its performance. Here are the results:
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
+
- **Accuracy**: 0.77%
|
| 54 |
+
- **Average Inference Time**: 0.1448 seconds per question
|
| 55 |
---
|
| 56 |
|
| 57 |
## Training Data
|