Instructions to use obss/gpt2-xl-question-generation-acs-mrqa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use obss/gpt2-xl-question-generation-acs-mrqa with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="obss/gpt2-xl-question-generation-acs-mrqa")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("obss/gpt2-xl-question-generation-acs-mrqa") model = AutoModelForCausalLM.from_pretrained("obss/gpt2-xl-question-generation-acs-mrqa", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use obss/gpt2-xl-question-generation-acs-mrqa with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "obss/gpt2-xl-question-generation-acs-mrqa" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "obss/gpt2-xl-question-generation-acs-mrqa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/obss/gpt2-xl-question-generation-acs-mrqa
- SGLang
How to use obss/gpt2-xl-question-generation-acs-mrqa 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 "obss/gpt2-xl-question-generation-acs-mrqa" \ --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": "obss/gpt2-xl-question-generation-acs-mrqa", "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 "obss/gpt2-xl-question-generation-acs-mrqa" \ --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": "obss/gpt2-xl-question-generation-acs-mrqa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use obss/gpt2-xl-question-generation-acs-mrqa with Docker Model Runner:
docker model run hf.co/obss/gpt2-xl-question-generation-acs-mrqa
Download model_training_args.json from obss/gpt2-xl-question-generation-acs-mrqa: direct link, hf CLI and curl.
- Browser
- Download file 724 Bytes
-
https://huggingface.co/obss/gpt2-xl-question-generation-acs-mrqa/resolve/main/model_training_args.json
- Command line
-
hf download hf://obss/gpt2-xl-question-generation-acs-mrqa/model_training_args.json
-
curl -L -o model_training_args.json https://huggingface.co/obss/gpt2-xl-question-generation-acs-mrqa/resolve/main/model_training_args.json
724 Bytes
| {"model_type": "gpt2-xl", "model_checkpoint": "gpt2-xl", "device": "cuda:0", "use_clue": true, "use_style": true, "answer_format": "text", "clue_format": "text", "seed": 0, "optim": "rmsprop", "train_batch_size": 6, "dev_batch_size": 16, "gradient_accumulation_steps": 1, "lr": 1.55e-05, "max_norm": 1.0, "n_epochs": 3, "eval_before_start": true, "dataset_cache_dir": "/home/ubuntu/bsbs/caches/datasets", "dataset_dir": "/home/ubuntu/bsbs/datasets/qg", "local_rank": 0, "output_dir": "/home/ubuntu/bsbs/outputs/train", "checkpoint_backup_dir": "/home/ubuntu/bsbs/checkpoints", "save_interval_epoch": 1, "iters_to_evaluate": 1818, "n_saved_epoch": 1, "use_amp": false, "use_gradient_checkpointing": true, "distributed": true} |