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.
For GPU support, ensure you have CUDA installed and configured properly.
1from transformers import pipeline
2
3# Initialize the pipeline
4pipe = pipeline("text-generation", model="openai/gpt-oss-safeguard-20b")
5
6# Create a conversation
7messages = [
8 {"role": "user", "content": "Can you write a short story about a cat?"},
9]
10
11# Generate text
12output = pipe(messages)
13print(output[0]['generated_text'])
The 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.