Text Generation
Transformers
PyTorch
Safetensors
opt
instruction-tuning
text-generation-inference
text2text-generation
Instructions to use akoksal/LongForm-OPT-2.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use akoksal/LongForm-OPT-2.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="akoksal/LongForm-OPT-2.7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("akoksal/LongForm-OPT-2.7B") model = AutoModelForCausalLM.from_pretrained("akoksal/LongForm-OPT-2.7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use akoksal/LongForm-OPT-2.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "akoksal/LongForm-OPT-2.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "akoksal/LongForm-OPT-2.7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/akoksal/LongForm-OPT-2.7B
- SGLang
How to use akoksal/LongForm-OPT-2.7B 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 "akoksal/LongForm-OPT-2.7B" \ --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": "akoksal/LongForm-OPT-2.7B", "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 "akoksal/LongForm-OPT-2.7B" \ --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": "akoksal/LongForm-OPT-2.7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use akoksal/LongForm-OPT-2.7B with Docker Model Runner:
docker model run hf.co/akoksal/LongForm-OPT-2.7B
Commit History
Update README.md dfb2a7e verified
Update README.md 3ee8c4f
Update README.md 032665d
Update README.md 77f68ce
Update README.md a820aca
Update README.md 2649f69
Adding `safetensors` variant of this model (#1) 0b718d9
Update README.md 2a0dfd9
Update README.md 828203a
Update README.md 4544673
Update README.md 47f2b12
Update README.md e90cc8c
Update README.md 27da398
Update README.md 0c52000
Update README.md fd38dbe
Update README.md 877239e
Update README.md 4129d8c
Update README.md 7c9ae33
Update README.md 55c47da
Update README.md 7b9abff
Update README.md a113de6
Update README.md f500b31
Update README.md 3daaac4
Update README.md 3ba7d1d
Update README.md f46f953
Create README.md e04b522
first commit 087b8c5
Abdullatif Koksal commited on