Instructions to use microsoft/Dayhoff-170m-UR50 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/Dayhoff-170m-UR50 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="microsoft/Dayhoff-170m-UR50")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/Dayhoff-170m-UR50") model = AutoModelForCausalLM.from_pretrained("microsoft/Dayhoff-170m-UR50", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use microsoft/Dayhoff-170m-UR50 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/Dayhoff-170m-UR50" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/Dayhoff-170m-UR50", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/microsoft/Dayhoff-170m-UR50
- SGLang
How to use microsoft/Dayhoff-170m-UR50 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/Dayhoff-170m-UR50" \ --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/Dayhoff-170m-UR50", "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/Dayhoff-170m-UR50" \ --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/Dayhoff-170m-UR50", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use microsoft/Dayhoff-170m-UR50 with Docker Model Runner:
docker model run hf.co/microsoft/Dayhoff-170m-UR50
Add installation instructions
Browse files
README.md
CHANGED
|
@@ -45,7 +45,42 @@ This model should not be used to generate anything that is not a protein sequenc
|
|
| 45 |
|
| 46 |
## How to Get Started with the Model
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
```py
|
| 51 |
|
|
|
|
| 45 |
|
| 46 |
## How to Get Started with the Model
|
| 47 |
|
| 48 |
+
The simplest way to use these models and datasets is via the HuggingFace interface. You will need PyTorch, mamba=ssm, causal-conv1d, and flash-attn.
|
| 49 |
+
|
| 50 |
+
**Requirements**:
|
| 51 |
+
* PyTorch: 2.7.1
|
| 52 |
+
* CUDA 12.8 and above
|
| 53 |
+
|
| 54 |
+
We recommend using [uv](https://docs.astral.sh/uv/getting-started/installation/#standalone-installer) and creating a clean environment.
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
```bash
|
| 58 |
+
uv venv dayhoff
|
| 59 |
+
source dayhoff/bin/activate
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
In that new environment, install PyTorch 2.7.1.
|
| 63 |
+
```bash
|
| 64 |
+
uv pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
Now, we need to install mamba-ssm, flash-attn, causal-conv1d, and their prerequisites.
|
| 68 |
+
|
| 69 |
+
```bash
|
| 70 |
+
uv pip install wheel packaging
|
| 71 |
+
uv pip install --no-build-isolation flash-attn causal-conv1d mamba-ssm
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
To import from HuggingFace, you will need to install these versions:
|
| 75 |
+
|
| 76 |
+
```bash
|
| 77 |
+
uv pip install datasets==3.2.0 #for HF datasets
|
| 78 |
+
uv pip install transformers==4.51.0
|
| 79 |
+
uv pip install huggingface_hub~=0.34.4
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
**Sample protein generation code:**
|
| 83 |
+
|
| 84 |
|
| 85 |
```py
|
| 86 |
|