Text Generation
Transformers
Safetensors
mixtral
biology
protein-language-model
protein-generation
causal-lm
mixture-of-experts
text-generation-inference
Instructions to use protgpt3/ProtGPT3-1.3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use protgpt3/ProtGPT3-1.3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="protgpt3/ProtGPT3-1.3B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("protgpt3/ProtGPT3-1.3B") model = AutoModelForCausalLM.from_pretrained("protgpt3/ProtGPT3-1.3B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use protgpt3/ProtGPT3-1.3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "protgpt3/ProtGPT3-1.3B" # 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-1.3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/protgpt3/ProtGPT3-1.3B
- SGLang
How to use protgpt3/ProtGPT3-1.3B 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-1.3B" \ --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-1.3B", "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-1.3B" \ --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-1.3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use protgpt3/ProtGPT3-1.3B with Docker Model Runner:
docker model run hf.co/protgpt3/ProtGPT3-1.3B
Update README.md
Browse files
README.md
CHANGED
|
@@ -93,7 +93,7 @@ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
|
| 93 |
|
| 94 |
with torch.no_grad():
|
| 95 |
output_ids = model.generate(
|
| 96 |
-
|
| 97 |
max_new_tokens=512,
|
| 98 |
do_sample=True,
|
| 99 |
temperature=0.8,
|
|
@@ -118,7 +118,7 @@ inputs = tokenizer(prefix, return_tensors="pt").to(model.device)
|
|
| 118 |
|
| 119 |
with torch.no_grad():
|
| 120 |
output_ids = model.generate(
|
| 121 |
-
|
| 122 |
max_new_tokens=256,
|
| 123 |
do_sample=True,
|
| 124 |
temperature=0.8,
|
|
@@ -150,7 +150,7 @@ inputs = tokenizer(
|
|
| 150 |
|
| 151 |
with torch.no_grad():
|
| 152 |
output_ids = model.generate(
|
| 153 |
-
|
| 154 |
max_new_tokens=256,
|
| 155 |
do_sample=True,
|
| 156 |
temperature=0.8,
|
|
|
|
| 93 |
|
| 94 |
with torch.no_grad():
|
| 95 |
output_ids = model.generate(
|
| 96 |
+
inputs["input_ids"],
|
| 97 |
max_new_tokens=512,
|
| 98 |
do_sample=True,
|
| 99 |
temperature=0.8,
|
|
|
|
| 118 |
|
| 119 |
with torch.no_grad():
|
| 120 |
output_ids = model.generate(
|
| 121 |
+
inputs["input_ids"],
|
| 122 |
max_new_tokens=256,
|
| 123 |
do_sample=True,
|
| 124 |
temperature=0.8,
|
|
|
|
| 150 |
|
| 151 |
with torch.no_grad():
|
| 152 |
output_ids = model.generate(
|
| 153 |
+
inputs["input_ids"],
|
| 154 |
max_new_tokens=256,
|
| 155 |
do_sample=True,
|
| 156 |
temperature=0.8,
|