Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use psxjp5/mlm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use psxjp5/mlm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="psxjp5/mlm")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("psxjp5/mlm") model = AutoModelForCausalLM.from_pretrained("psxjp5/mlm") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use psxjp5/mlm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "psxjp5/mlm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "psxjp5/mlm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/psxjp5/mlm
- SGLang
How to use psxjp5/mlm 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 "psxjp5/mlm" \ --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": "psxjp5/mlm", "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 "psxjp5/mlm" \ --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": "psxjp5/mlm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use psxjp5/mlm with Docker Model Runner:
docker model run hf.co/psxjp5/mlm
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,26 +8,24 @@ model-index:
|
|
| 8 |
results: []
|
| 9 |
---
|
| 10 |
|
| 11 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 12 |
-
should probably proofread and complete it, then remove this comment. -->
|
| 13 |
-
|
| 14 |
# mlm_final
|
| 15 |
|
| 16 |
-
This model is a fine-tuned version of [gpt2](https://huggingface.co/gpt2) on
|
| 17 |
-
It achieves the following results on the evaluation set:
|
| 18 |
- Loss: 4.0700
|
|
|
|
| 19 |
|
| 20 |
## Model description
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
## Intended uses & limitations
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
## Training and evaluation data
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
## Training procedure
|
| 33 |
|
|
|
|
| 8 |
results: []
|
| 9 |
---
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
# mlm_final
|
| 12 |
|
| 13 |
+
This model is a fine-tuned version of [gpt2](https://huggingface.co/gpt2) on a custom dataset using the Digital Image Processing textbook (Gonzalez and Woods, 2018).
|
| 14 |
+
It achieves the following results on the evaluation set, which used the Fundamentals of Digital Image Processing textbook (Solomon and Breckon, 2010):
|
| 15 |
- Loss: 4.0700
|
| 16 |
+
- Perplexity: 58.6
|
| 17 |
|
| 18 |
## Model description
|
| 19 |
|
| 20 |
+
This model is trained using Masked Language Modelling.
|
| 21 |
|
| 22 |
## Intended uses & limitations
|
| 23 |
|
| 24 |
+
This model is intended for use within the field of Computer Vision, as is trained using a Computer Vision textbook.
|
| 25 |
|
| 26 |
## Training and evaluation data
|
| 27 |
|
| 28 |
+
It is trained and validated using computer vision textbooks split into chunks of 512 tokens
|
| 29 |
|
| 30 |
## Training procedure
|
| 31 |
|