Text Generation
Transformers
Safetensors
mixtral
biology
protein-language-model
protein-generation
causal-lm
mixture-of-experts
dpo
alignment
protein-design
text-generation-inference
Instructions to use protgpt3/ProtGPT3-10B-dpo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use protgpt3/ProtGPT3-10B-dpo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="protgpt3/ProtGPT3-10B-dpo")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("protgpt3/ProtGPT3-10B-dpo") model = AutoModelForCausalLM.from_pretrained("protgpt3/ProtGPT3-10B-dpo") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use protgpt3/ProtGPT3-10B-dpo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "protgpt3/ProtGPT3-10B-dpo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "protgpt3/ProtGPT3-10B-dpo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/protgpt3/ProtGPT3-10B-dpo
- SGLang
How to use protgpt3/ProtGPT3-10B-dpo 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 "protgpt3/ProtGPT3-10B-dpo" \ --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": "protgpt3/ProtGPT3-10B-dpo", "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 "protgpt3/ProtGPT3-10B-dpo" \ --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": "protgpt3/ProtGPT3-10B-dpo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use protgpt3/ProtGPT3-10B-dpo with Docker Model Runner:
docker model run hf.co/protgpt3/ProtGPT3-10B-dpo
Update README.md
Browse files
README.md
CHANGED
|
@@ -106,7 +106,7 @@ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
|
| 106 |
|
| 107 |
with torch.no_grad():
|
| 108 |
output_ids = model.generate(
|
| 109 |
-
|
| 110 |
max_new_tokens=512,
|
| 111 |
do_sample=True,
|
| 112 |
temperature=0.8,
|
|
@@ -131,7 +131,7 @@ inputs = tokenizer(prefix, return_tensors="pt").to(model.device)
|
|
| 131 |
|
| 132 |
with torch.no_grad():
|
| 133 |
output_ids = model.generate(
|
| 134 |
-
|
| 135 |
max_new_tokens=256,
|
| 136 |
do_sample=True,
|
| 137 |
temperature=0.8,
|
|
@@ -163,7 +163,7 @@ inputs = tokenizer(
|
|
| 163 |
|
| 164 |
with torch.no_grad():
|
| 165 |
output_ids = model.generate(
|
| 166 |
-
|
| 167 |
max_new_tokens=256,
|
| 168 |
do_sample=True,
|
| 169 |
temperature=0.8,
|
|
|
|
| 106 |
|
| 107 |
with torch.no_grad():
|
| 108 |
output_ids = model.generate(
|
| 109 |
+
inputs["input_ids"],
|
| 110 |
max_new_tokens=512,
|
| 111 |
do_sample=True,
|
| 112 |
temperature=0.8,
|
|
|
|
| 131 |
|
| 132 |
with torch.no_grad():
|
| 133 |
output_ids = model.generate(
|
| 134 |
+
inputs["input_ids"],
|
| 135 |
max_new_tokens=256,
|
| 136 |
do_sample=True,
|
| 137 |
temperature=0.8,
|
|
|
|
| 163 |
|
| 164 |
with torch.no_grad():
|
| 165 |
output_ids = model.generate(
|
| 166 |
+
inputs["input_ids"],
|
| 167 |
max_new_tokens=256,
|
| 168 |
do_sample=True,
|
| 169 |
temperature=0.8,
|