Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Alphafold3
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RC Data Science
community-containers
Alphafold3
Commits
025701f0
Commit
025701f0
authored
6 months ago
by
Augustin Zidek
Browse files
Options
Downloads
Patches
Plain Diff
Use model dir flag for run_alphafold_test
PiperOrigin-RevId: 698034193
parent
65328c9c
No related branches found
No related tags found
1 merge request
!1
Cloned AlphaFold 3 repo into this one
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
run_alphafold.py
+8
-8
8 additions, 8 deletions
run_alphafold.py
run_alphafold_test.py
+3
-3
3 additions, 3 deletions
run_alphafold_test.py
with
11 additions
and
11 deletions
run_alphafold.py
+
8
−
8
View file @
025701f0
...
...
@@ -56,8 +56,8 @@ import numpy as np
_HOME_DIR
=
pathlib
.
Path
(
os
.
environ
.
get
(
'
HOME
'
))
DEFAULT_MODEL_DIR
=
_HOME_DIR
/
'
models
'
DEFAULT_DB_DIR
=
_HOME_DIR
/
'
public_databases
'
_
DEFAULT_MODEL_DIR
=
_HOME_DIR
/
'
models
'
_
DEFAULT_DB_DIR
=
_HOME_DIR
/
'
public_databases
'
# Input and output paths.
...
...
@@ -77,9 +77,9 @@ _OUTPUT_DIR = flags.DEFINE_string(
'
Path to a directory where the results will be saved.
'
,
)
_
MODEL_DIR
=
flags
.
DEFINE_string
(
MODEL_DIR
=
flags
.
DEFINE_string
(
'
model_dir
'
,
DEFAULT_MODEL_DIR
.
as_posix
(),
_
DEFAULT_MODEL_DIR
.
as_posix
(),
'
Path to the model to use for inference.
'
,
)
...
...
@@ -137,9 +137,9 @@ _HMMBUILD_BINARY_PATH = flags.DEFINE_string(
)
# Database paths.
_
DB_DIR
=
flags
.
DEFINE_multi_string
(
DB_DIR
=
flags
.
DEFINE_multi_string
(
'
db_dir
'
,
(
DEFAULT_DB_DIR
.
as_posix
(),),
(
_
DEFAULT_DB_DIR
.
as_posix
(),),
'
Path to the directory containing the databases. Can be specified multiple
'
'
times to search multiple directories in order.
'
,
)
...
...
@@ -635,7 +635,7 @@ def main(_):
print
(
'
\n
'
.
join
(
notice
))
if
_RUN_DATA_PIPELINE
.
value
:
expand_path
=
lambda
x
:
replace_db_dir
(
x
,
_
DB_DIR
.
value
)
expand_path
=
lambda
x
:
replace_db_dir
(
x
,
DB_DIR
.
value
)
data_pipeline_config
=
pipeline
.
DataPipelineConfig
(
jackhmmer_binary_path
=
_JACKHMMER_BINARY_PATH
.
value
,
nhmmer_binary_path
=
_NHMMER_BINARY_PATH
.
value
,
...
...
@@ -673,7 +673,7 @@ def main(_):
)
),
device
=
devices
[
0
],
model_dir
=
pathlib
.
Path
(
_
MODEL_DIR
.
value
),
model_dir
=
pathlib
.
Path
(
MODEL_DIR
.
value
),
)
else
:
print
(
'
Skipping running model inference.
'
)
...
...
This diff is collapsed.
Click to expand it.
run_alphafold_test.py
+
3
−
3
View file @
025701f0
...
...
@@ -184,7 +184,7 @@ class InferenceTest(test_utils.StructureTestCase):
model_class
=
run_alphafold
.
diffusion_model
.
Diffuser
,
config
=
run_alphafold
.
make_model_config
(),
device
=
jax
.
local_devices
()[
0
],
model_dir
=
run_alphafold
.
DEFAULT_
MODEL_DIR
,
model_dir
=
pathlib
.
Path
(
run_alphafold
.
MODEL_DIR
.
value
)
,
)
def
compare_golden
(
self
,
result_path
:
str
)
->
None
:
...
...
@@ -301,7 +301,7 @@ class InferenceTest(test_utils.StructureTestCase):
model_class
=
diffusion_model
.
Diffuser
,
config
=
run_alphafold
.
make_model_config
(),
device
=
jax
.
local_devices
(
backend
=
'
gpu
'
)[
0
],
model_dir
=
pathlib
.
Path
(
run_alphafold
.
DEFAULT_
MODEL_DIR
),
model_dir
=
pathlib
.
Path
(
run_alphafold
.
MODEL_DIR
.
value
),
),
output_dir
=
'
unused output dir
'
,
)
...
...
@@ -332,7 +332,7 @@ class InferenceTest(test_utils.StructureTestCase):
model_class
=
diffusion_model
.
Diffuser
,
config
=
run_alphafold
.
make_model_config
(),
device
=
jax
.
local_devices
(
backend
=
'
gpu
'
)[
0
],
model_dir
=
pathlib
.
Path
(
run_alphafold
.
DEFAULT_
MODEL_DIR
),
model_dir
=
pathlib
.
Path
(
run_alphafold
.
MODEL_DIR
.
value
),
),
output_dir
=
output_dir
,
buckets
=
None
if
bucket
is
None
else
[
bucket
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment