File size: 4,851 Bytes
f5285d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2f15763
f5285d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
license: mit
language:
- en
- zh
tags:
- OneScience
- protein-structure-prediction
- pytorch
---
<p align="center">
  <strong>
    <span style="font-size: 30px;">SimpleFold</span>
  </strong>
</p>

# Model Introduction

SimpleFold is a generative protein folding model released by Apple. It supports protein structure prediction and provides training and fine-tuning entry points.

# Model Description

SimpleFold uses standard Transformer layers and a flow-matching objective to predict three-dimensional protein structures from FASTA sequences.

This Hugging Face package includes a default FASTA example, SimpleFold weights, pLDDT weights, CCD auxiliary files, Boltz auxiliary weights, and local ESM-2 3B weights. The package is ready to use once the full download is complete.

# Use Cases

| Scenario | Description |
| :---: | :--- |
| Protein structure prediction | Takes a FASTA file as input and outputs structures in mmCIF or PDB format. |
| Local offline inference | Stores example inputs and weights in `examples/` and `weight/`, allowing the scripts to run entirely from files in this repository. |
| Training / fine-tuning pipeline validation | Supports training workflow validation after tokenized data have been prepared according to `config/data/*.yaml`. |
| Hugging Face package layout | Uses the standard `config/`, `models/`, `scripts/`, and `weight/` directory structure. |

# Usage Guide

## 1. OneCode Usage

Try one-click AI4S development in the OneCode online environment:

[Try one-click AI4S development](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)

## 2. Manual Installation and Usage

**Hardware Requirements**

- GPU or DCU is recommended.
- A CPU can be used for basic connectivity checks, but execution will be slow.
- DCU users must install DTK in advance. DTK 25.04.2 or later is recommended, or a OneScience-recommended version matching the current cluster.

**Software Requirements**

For additional information about the adaptation, please contact liubiao@sugon.com.

**Environment Check**

- NVIDIA GPU:

```bash
nvidia-smi
```

- Hygon DCU:

```bash
hy-smi
```

## Quick Start

### 1. Install the Runtime Environment

```bash
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[bio] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai
```

If required libraries cannot be found, activate the CUDA compatibility environment as follows:

```bash
source ${ROCM_PATH}/cuda/env.sh
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib/python3.11/site-packages/fastpt/torch/lib:$LD_LIBRARY_PATH"
```

### 2. Download the Model Package

```bash
hf download --model OneScience-Group/SimpleFold --local-dir ./SimpleFold
cd SimpleFold
```

### Model Weights

The trained model weights are included in the `weights/` directory, including SimpleFold-1B and SimpleFold-100M checkpoints, ESM weights, and other supporting weights.

### 3. Run Inference

```bash
python scripts/run_inference.py \
  --simplefold_model simplefold_100M \
  --fasta_path examples/minimal.fasta \
  --output_dir outputs/minimal_inference \
  --num_steps 10 \
  --tau 0.01 \
  --nsample_per_protein 1 \
  --backend torch
```

Output directory:

```text
outputs/minimal_inference/predictions_simplefold_100M/
```

### 4. Training — No Dataset Currently Provided

Before training, prepare the following paths:

```text
datasets/
datasets/tokenized/
datasets/manifest.json
```

Data processing:

```bash
python scripts/process_data.py --data_dir /path/to/mmcif --out_dir datasets --num-processes 8
python scripts/tokenize_data.py --target_dir datasets --token_dir datasets/tokenized
```

`process_data.py` uses the in-package `weight/ccd.pkl` by default; no additional CCD download or Redis setup is required. To use the legacy Redis CCD workflow, pass `--use-redis` explicitly.

Training:

```bash
python scripts/train.py
```

FSDP training:

```bash
python scripts/train_fsdp.py experiment=train_fsdp
```

Fine-tuning / training-resumption example:

```bash
python scripts/train.py load_ckpt_path=weight/simplefold_100M.ckpt
```

# OneScience Official Information

| Platform | OneScience Main Repository | Skills Repository |
| --- | --- | --- |
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |

# Citation & License

The original SimpleFold implementation is released under the MIT License. This repository retains attribution to the original source and is organized to support automated execution through OneScience on Hugging Face. For scientific use, please cite the original SimpleFold paper and the relevant OneScience project materials.