Downloads · 30 days
0
ahczhg/gpt-oss-safeguard-20b-demo
gpt-oss-safeguard-20b-demo is a machine learning model from ahczhg. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository demonstrates the usage of OpenAI's GPT-OSS-Safeguard-20B model for text generation tasks.
Downloads · 30 days
0
Access
Public
Updated Nov 2, 2025
Repo size
—
Likes
1
Public
Click a slice to open those files.
.ipynb108 KB · 96%
From the Hugging Face model README
This repository demonstrates the usage of OpenAI's GPT-OSS-Safeguard-20B model for text generation tasks.
GPT-OSS-Safeguard-20B is a large language model designed for safe and responsible text generation. This project provides a simple implementation using the Hugging Face Transformers library.
pip install -U transformers torch
For GPU support, ensure you have CUDA installed and configured properly.
The notebook demonstrates basic usage:
from transformers import pipeline
# Initialize the pipeline
pipe = pipeline("text-generation", model="openai/gpt-oss-safeguard-20b")
# Create a conversation
messages = [
{"role": "user", "content": "Can you write a short story about a cat?"},
]
# Generate text
output = pipe(messages)
print(output[0]['generated_text'])
gpt-oss-safeguard-20b.ipynb: Jupyter notebook with example implementationThe model generates coherent and creative text based on the input prompts. In the example, when asked to write a short story about a cat, the model analyzes the request and begins crafting a narrative with character development and setting details.
Feel free to open issues or submit pull requests for improvements.
MIT License - See LICENSE file for details.