Text Generation
Transformers
Safetensors
PyTorch
English
gpt2
code-completion
huggingface
codexglue
nlp
machine-learning
Instructions to use Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE
- SGLang
How to use Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE 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 "Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE" \ --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": "Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE", "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 "Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE" \ --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": "Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE with Docker Model Runner:
docker model run hf.co/Sai-Nandu/Code-Completion-using-GPT-2-CodeXGLUE
- Xet hash:
- b687f5e8c08f7333c6e3bfd495a7a9d6df20e6c1e0cacd59bdb2b2a7fcf2dbba
- Size of remote file:
- 1.38 kB
- SHA256:
- f957bf2bf26eea756b13c8a823907ad793586dffb822ebcb130ee9b6f3a74c80
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.