Text Generation
Transformers
Safetensors
English
gpt2
cybersecurity
passwords
text-generation-inference
Instructions to use CodeferSystem/GPT2-Hacker-password-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CodeferSystem/GPT2-Hacker-password-generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CodeferSystem/GPT2-Hacker-password-generator")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CodeferSystem/GPT2-Hacker-password-generator") model = AutoModelForCausalLM.from_pretrained("CodeferSystem/GPT2-Hacker-password-generator") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use CodeferSystem/GPT2-Hacker-password-generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CodeferSystem/GPT2-Hacker-password-generator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CodeferSystem/GPT2-Hacker-password-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CodeferSystem/GPT2-Hacker-password-generator
- SGLang
How to use CodeferSystem/GPT2-Hacker-password-generator 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 "CodeferSystem/GPT2-Hacker-password-generator" \ --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": "CodeferSystem/GPT2-Hacker-password-generator", "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 "CodeferSystem/GPT2-Hacker-password-generator" \ --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": "CodeferSystem/GPT2-Hacker-password-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CodeferSystem/GPT2-Hacker-password-generator with Docker Model Runner:
docker model run hf.co/CodeferSystem/GPT2-Hacker-password-generator
Update README.md
Browse files- Updated model loading due to username change.
- Updated incorrect information in the number of dataset examples.
README.md
CHANGED
|
@@ -3,6 +3,9 @@ license: apache-2.0
|
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
| 6 |
---
|
| 7 |
# GPT-2 Hacker password generator.
|
| 8 |
This model can generate hacker passwords.
|
|
@@ -16,7 +19,7 @@ Loss: 0.519600
|
|
| 16 |
|
| 17 |
Fine-tuning time: almost 34:39 on Nvidia Geforce RTX 4060 8 GB GPU (laptop)
|
| 18 |
|
| 19 |
-
Fine-tuned on
|
| 20 |
|
| 21 |
# Using the model
|
| 22 |
Use this code:
|
|
@@ -25,7 +28,7 @@ Use this code:
|
|
| 25 |
from transformers import GPT2Tokenizer, GPT2LMHeadModel
|
| 26 |
import torch
|
| 27 |
|
| 28 |
-
model_name = "
|
| 29 |
|
| 30 |
# Load the pre-trained GPT-2 model and tokenizer from the specified directory
|
| 31 |
tokenizer = GPT2Tokenizer.from_pretrained(model_name) # Load standard GPT-2 tokenizer
|
|
|
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
+
base_model:
|
| 7 |
+
- openai-community/gpt2
|
| 8 |
+
library_name: transformers
|
| 9 |
---
|
| 10 |
# GPT-2 Hacker password generator.
|
| 11 |
This model can generate hacker passwords.
|
|
|
|
| 19 |
|
| 20 |
Fine-tuning time: almost 34:39 on Nvidia Geforce RTX 4060 8 GB GPU (laptop)
|
| 21 |
|
| 22 |
+
Fine-tuned on 20k examples of 128 tokens.
|
| 23 |
|
| 24 |
# Using the model
|
| 25 |
Use this code:
|
|
|
|
| 28 |
from transformers import GPT2Tokenizer, GPT2LMHeadModel
|
| 29 |
import torch
|
| 30 |
|
| 31 |
+
model_name = "CodeferSystem/GPT2-Hacker-password-generator"
|
| 32 |
|
| 33 |
# Load the pre-trained GPT-2 model and tokenizer from the specified directory
|
| 34 |
tokenizer = GPT2Tokenizer.from_pretrained(model_name) # Load standard GPT-2 tokenizer
|