Text Generation
Transformers
Safetensors
English
gpt2
Generated from Trainer
text-generation-inference
Instructions to use JstnMcBrd/gpt2-finetuned-python-purpose with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JstnMcBrd/gpt2-finetuned-python-purpose with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="JstnMcBrd/gpt2-finetuned-python-purpose")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("JstnMcBrd/gpt2-finetuned-python-purpose") model = AutoModelForCausalLM.from_pretrained("JstnMcBrd/gpt2-finetuned-python-purpose") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use JstnMcBrd/gpt2-finetuned-python-purpose with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JstnMcBrd/gpt2-finetuned-python-purpose" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JstnMcBrd/gpt2-finetuned-python-purpose", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/JstnMcBrd/gpt2-finetuned-python-purpose
- SGLang
How to use JstnMcBrd/gpt2-finetuned-python-purpose 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 "JstnMcBrd/gpt2-finetuned-python-purpose" \ --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": "JstnMcBrd/gpt2-finetuned-python-purpose", "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 "JstnMcBrd/gpt2-finetuned-python-purpose" \ --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": "JstnMcBrd/gpt2-finetuned-python-purpose", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use JstnMcBrd/gpt2-finetuned-python-purpose with Docker Model Runner:
docker model run hf.co/JstnMcBrd/gpt2-finetuned-python-purpose
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,6 +7,10 @@ tags:
|
|
| 7 |
model-index:
|
| 8 |
- name: gpt2-finetuned-python-purpose
|
| 9 |
results: []
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
@@ -14,7 +18,7 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 14 |
|
| 15 |
# gpt2-finetuned-python-purpose
|
| 16 |
|
| 17 |
-
This model is a fine-tuned version of [openai-community/gpt2](https://huggingface.co/openai-community/gpt2) on
|
| 18 |
It achieves the following results on the evaluation set:
|
| 19 |
- Loss: 0.4763
|
| 20 |
|
|
@@ -59,4 +63,4 @@ The following hyperparameters were used during training:
|
|
| 59 |
- Transformers 4.57.1
|
| 60 |
- Pytorch 2.4.1+cu121
|
| 61 |
- Datasets 4.4.1
|
| 62 |
-
- Tokenizers 0.22.1
|
|
|
|
| 7 |
model-index:
|
| 8 |
- name: gpt2-finetuned-python-purpose
|
| 9 |
results: []
|
| 10 |
+
datasets:
|
| 11 |
+
- flytech/python-codes-25k
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
---
|
| 15 |
|
| 16 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 18 |
|
| 19 |
# gpt2-finetuned-python-purpose
|
| 20 |
|
| 21 |
+
This model is a fine-tuned version of [openai-community/gpt2](https://huggingface.co/openai-community/gpt2) on [flytech/python-codes-25k](https://huggingface.co/flytech/python-codes-25k).
|
| 22 |
It achieves the following results on the evaluation set:
|
| 23 |
- Loss: 0.4763
|
| 24 |
|
|
|
|
| 63 |
- Transformers 4.57.1
|
| 64 |
- Pytorch 2.4.1+cu121
|
| 65 |
- Datasets 4.4.1
|
| 66 |
+
- Tokenizers 0.22.1
|