Skip to content

Commit 429b022

Browse files
committed
updated inference scripts
1 parent 708ec3d commit 429b022

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

infer_grn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
TestDatasets = ConcatDataset(All_test_dataset)
100100

101101
test_loader = DataListLoader(dataset=TestDatasets, batch_size=BATCH_SIZE, shuffle=False, num_workers=1)
102-
model = GRNFormerLitModule(totalnodes=numnodes, tf_file = tffile, exp_file = os.path.abspath(args.exp_file), net_file=os.path.abspath(args.net_file), output_file=os.path.abspath(args.output_file))
102+
model = GRNFormerLitModule(totalnodes=numnodes, tf_file = tffile, exp_file = os.path.abspath(args.exp_file), output_file=os.path.abspath(args.output_file))
103103
print("Model loaded")
104104
# trainer = pl.Trainer.from_argparse_args(args)
105105
trainer = Trainer(devices=[0], num_nodes=1, accelerator = ACCELERATOR, detect_anomaly = True, enable_model_summary = True)

setup.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@ if [[ ! -d "$HOME/miniconda" ]]; then
88
fi
99
export PATH="$HOME/miniconda/bin:$PATH"
1010
source "$HOME/miniconda/etc/profile.d/conda.sh"
11-
# Create Conda environment if it doesn't exist
12-
if ! conda env list | grep -qw grnformer; then
11+
# Create Conda environment if it doesn't exist (check by name in this install)
12+
if ! conda env list | awk 'NR>2 && $1=="grnformer" { exit 0 } END { exit 1 }'; then
1313
conda env create -f environment.yml -n grnformer
1414
fi
1515
conda activate grnformer
16-
echo "Setup complete. Use: conda activate grnformer"
16+
17+
# Ensure this Miniconda is used in new shells so "conda activate grnformer" works by name
18+
CONDA_INIT="source \"$HOME/miniconda/etc/profile.d/conda.sh\""
19+
if [[ -f "$HOME/.bashrc" ]] && ! grep -q "miniconda/etc/profile.d/conda.sh" "$HOME/.bashrc"; then
20+
echo "" >> "$HOME/.bashrc"
21+
echo "# GRNformer: use this Miniconda so 'conda activate grnformer' works" >> "$HOME/.bashrc"
22+
echo "$CONDA_INIT" >> "$HOME/.bashrc"
23+
echo "Added Miniconda init to ~/.bashrc"
24+
fi
25+
echo "Setup complete. In new terminals use: conda activate grnformer"
26+
echo "In this shell you are already in the grnformer env."
1727

0 commit comments

Comments
 (0)