Instructions to use microsoft/biogpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/biogpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="microsoft/biogpt")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/biogpt") model = AutoModelForCausalLM.from_pretrained("microsoft/biogpt") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use microsoft/biogpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/biogpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/biogpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/microsoft/biogpt
- SGLang
How to use microsoft/biogpt 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 "microsoft/biogpt" \ --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": "microsoft/biogpt", "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 "microsoft/biogpt" \ --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": "microsoft/biogpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use microsoft/biogpt with Docker Model Runner:
docker model run hf.co/microsoft/biogpt
Update config.json
Browse files- config.json +3 -0
config.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"BioGptLMHeadModel"
|
| 4 |
],
|
|
@@ -11,11 +12,13 @@
|
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
"intermediate_size": 4096,
|
| 13 |
"layer_norm_eps": 1e-12,
|
|
|
|
| 14 |
"max_position_embeddings": 1024,
|
| 15 |
"model_type": "biogpt",
|
| 16 |
"num_attention_heads": 16,
|
| 17 |
"num_hidden_layers": 24,
|
| 18 |
"pad_token_id": 1,
|
|
|
|
| 19 |
"transformers_version": "4.25.0.dev0",
|
| 20 |
"use_cache": true,
|
| 21 |
"vocab_size": 42384
|
|
|
|
| 1 |
{
|
| 2 |
+
"activation_dropout": 0.0,
|
| 3 |
"architectures": [
|
| 4 |
"BioGptLMHeadModel"
|
| 5 |
],
|
|
|
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
"intermediate_size": 4096,
|
| 14 |
"layer_norm_eps": 1e-12,
|
| 15 |
+
"layerdrop": 0.0,
|
| 16 |
"max_position_embeddings": 1024,
|
| 17 |
"model_type": "biogpt",
|
| 18 |
"num_attention_heads": 16,
|
| 19 |
"num_hidden_layers": 24,
|
| 20 |
"pad_token_id": 1,
|
| 21 |
+
"scale_embedding": true,
|
| 22 |
"transformers_version": "4.25.0.dev0",
|
| 23 |
"use_cache": true,
|
| 24 |
"vocab_size": 42384
|