Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/pr-stage-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ jobs:
include:
- torch: 2.5.1
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
tool-cache: false
docker-images: false
# All of these default to true, but feel free to set to "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: false
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down Expand Up @@ -58,6 +70,18 @@ jobs:
matrix:
python-version: ['3.10']
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
tool-cache: false
docker-images: false
# All of these default to true, but feel free to set to "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: false
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down
10 changes: 10 additions & 0 deletions opencompass/datasets/SciReasoner/uncond_RNA.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ def score(self, predictions, references):
if len(seq) > 1024:
overlength_count += 1

if len(predictions) == invalid_count:
return {
'total_samples': len(predictions),
'invalid_prediction_count': invalid_count,
'overlength_prediction_count': overlength_count,
'valid_sequence_count': len(valid_rnas),
'average_mfe': 0,
'retrieved_rfam_family_count': 0,
}

with TemporaryDirectory() as tmpdir:
fasta_path = os.path.join(tmpdir, 'valid_sequences.fasta')
with open(fasta_path, 'w') as f:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def score(self, predictions, references=None):
"""
if not predictions:
return {
'num_length_less_100': 0,
'valid_rate': 0,
'average_length': 0,
'diversity': 0,
'average_plddt': 0,
Expand All @@ -138,6 +140,17 @@ def score(self, predictions, references=None):
predictions = [
pred for pred in predictions if not (pred.strip() == '')
]

if len(predictions) == 0:
return {
'num_length_less_100': 0,
'valid_rate': 0,
'average_length': 0,
'diversity': 0,
'average_plddt': 0,
'info': 'Input predictions list is empty.'
}

valid_rate = len(predictions) / ori_len

# --- 1. Compute Average Length ---
Expand Down
Loading