How to use from
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 "Roaoch/CyberClassic-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": "Roaoch/CyberClassic-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 "Roaoch/CyberClassic-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": "Roaoch/CyberClassic-Generator",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Quick Links

This text generator is based on OpenAI GPT2 model from HuggingFace Base model went through two step of learning

First - Finetining of base model

On this step model is finetuned on dataset of single sentence from the texts of Dostovesky F.M.

Training parameters:

  • Epoch = 10
  • Learning Rate = 1e-3
  • Optimizer = AdamW
  • Scheduler = OneCycleLR
  • Training env = PyTorch

image.png

image.png

Second - RL

On this step finetuned model went trough reinforcement learning pipline with TRL library.

Training parameters:

  • Epoch = 30
  • Trainer = PPO
  • Query texts = first 100 texts from dataset, trimmed by first 3 words
  • Reward = score from binary classifier multiplied by 10

image.png

image.png

Downloads last month
8
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using Roaoch/CyberClassic-Generator 1

Collection including Roaoch/CyberClassic-Generator