Instructions to use FinancialSupport/gpt2-ft-medical-qa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FinancialSupport/gpt2-ft-medical-qa with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FinancialSupport/gpt2-ft-medical-qa")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FinancialSupport/gpt2-ft-medical-qa") model = AutoModelForCausalLM.from_pretrained("FinancialSupport/gpt2-ft-medical-qa", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FinancialSupport/gpt2-ft-medical-qa with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FinancialSupport/gpt2-ft-medical-qa" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FinancialSupport/gpt2-ft-medical-qa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FinancialSupport/gpt2-ft-medical-qa
- SGLang
How to use FinancialSupport/gpt2-ft-medical-qa 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 "FinancialSupport/gpt2-ft-medical-qa" \ --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": "FinancialSupport/gpt2-ft-medical-qa", "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 "FinancialSupport/gpt2-ft-medical-qa" \ --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": "FinancialSupport/gpt2-ft-medical-qa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FinancialSupport/gpt2-ft-medical-qa with Docker Model Runner:
docker model run hf.co/FinancialSupport/gpt2-ft-medical-qa
Commit History
Update README.md 3265093
Update README.md 878efb2
Update README.md 4e375f7
Update README.md 1cc9b00
Update README.md 4b57022
Update README.md d977ce5
Update README.md d0e07e6
Update README.md b2a2e72
Update README.md 113c263
Update README.md c71ef5d
Update README.md 87d1235
Update README.md c20fcc3
Update README.md 43d97d2
Create README.md 31d494f
Resolved merge conflict in tokenizer.json c98ee83
FinancialSupport commited on
tokenizer 51898a5
FinancialSupport commited on
forgot tokenizer (?) a5aeb18
first commit 6043e64
FinancialSupport commited on
initial commit ae31ab2
Samuele Colombo commited on