Text Generation
Transformers
Safetensors
Russian
gpt2
text-adaptation
russian
gpt3
cefr
ruadapt
simplification
text-generation-inference
Instructions to use dwaru/RuAdaptGPT2Large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dwaru/RuAdaptGPT2Large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dwaru/RuAdaptGPT2Large")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dwaru/RuAdaptGPT2Large") model = AutoModelForCausalLM.from_pretrained("dwaru/RuAdaptGPT2Large", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dwaru/RuAdaptGPT2Large with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dwaru/RuAdaptGPT2Large" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dwaru/RuAdaptGPT2Large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dwaru/RuAdaptGPT2Large
- SGLang
How to use dwaru/RuAdaptGPT2Large 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 "dwaru/RuAdaptGPT2Large" \ --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": "dwaru/RuAdaptGPT2Large", "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 "dwaru/RuAdaptGPT2Large" \ --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": "dwaru/RuAdaptGPT2Large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dwaru/RuAdaptGPT2Large with Docker Model Runner:
docker model run hf.co/dwaru/RuAdaptGPT2Large
File size: 1,723 Bytes
1bbe5d9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | {
"best_metric": null,
"best_model_checkpoint": null,
"epoch": 0.8382229673093042,
"eval_steps": 500,
"global_step": 1000,
"is_hyper_param_search": false,
"is_local_process_zero": true,
"is_world_process_zero": true,
"log_history": [
{
"epoch": 0.4191114836546521,
"grad_norm": 0.951872706413269,
"learning_rate": 4.4761106454316845e-05,
"loss": 1.8004,
"step": 500
},
{
"epoch": 0.4191114836546521,
"eval_CEFR_f1": 0.3384662,
"eval_loss": 1.1508616209030151,
"eval_rouge1": 0.48,
"eval_rouge2": 0.29292929,
"eval_runtime": 15.0767,
"eval_samples_per_second": 6.633,
"eval_steps_per_second": 0.265,
"step": 500
},
{
"epoch": 0.8382229673093042,
"grad_norm": 1.0152556896209717,
"learning_rate": 3.95222129086337e-05,
"loss": 1.2466,
"step": 1000
},
{
"epoch": 0.8382229673093042,
"eval_CEFR_f1": 0.32371507,
"eval_loss": 1.0748347043991089,
"eval_rouge1": 0.5,
"eval_rouge2": 0.32323232,
"eval_runtime": 15.1501,
"eval_samples_per_second": 6.601,
"eval_steps_per_second": 0.264,
"step": 1000
}
],
"logging_steps": 500,
"max_steps": 4772,
"num_input_tokens_seen": 0,
"num_train_epochs": 4,
"save_steps": 500,
"stateful_callbacks": {
"TrainerControl": {
"args": {
"should_epoch_stop": false,
"should_evaluate": false,
"should_log": false,
"should_save": true,
"should_training_stop": false
},
"attributes": {}
}
},
"total_flos": 1.9193866223616e+16,
"train_batch_size": 32,
"trial_name": null,
"trial_params": null
}
|