Instructions to use saiful9379/Bangla_GPT2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use saiful9379/Bangla_GPT2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="saiful9379/Bangla_GPT2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("saiful9379/Bangla_GPT2") model = AutoModelForCausalLM.from_pretrained("saiful9379/Bangla_GPT2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use saiful9379/Bangla_GPT2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "saiful9379/Bangla_GPT2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "saiful9379/Bangla_GPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/saiful9379/Bangla_GPT2
- SGLang
How to use saiful9379/Bangla_GPT2 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 "saiful9379/Bangla_GPT2" \ --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": "saiful9379/Bangla_GPT2", "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 "saiful9379/Bangla_GPT2" \ --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": "saiful9379/Bangla_GPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use saiful9379/Bangla_GPT2 with Docker Model Runner:
docker model run hf.co/saiful9379/Bangla_GPT2
Commit History
-
Update README.md
d114135
-
Update README.md
f05e693 -
Update README.md
a355140 -
Update README.md
17e7fc2 -
Update README.md
aff4886 -
Update README.md
30206d4 -
Update README.md
371d540 -
update readme
ca6cd0e -
Update README.md
2f599c1 -
Delete README.md
846b6da -
Update README.md
2d743ea -
Update README.md
5febc01 -
add readme
efba808 -
add widget
1e4e225 -
Update config.json
9d4bda4 -
update inference config
066e33f -
change config
4a1210f -
change widget
d851aa5 -
add widget
7f09c4a -
add widget
5521368 -
change config
e9ab2d3 -
edite config file
1031d72 -
update readme
d00bac8 -
add readme
2f7c4a4 -
add gpt2 bangla training model
ea656af -
initial commit
d518c5f