@@ -63,6 +63,9 @@ void setup(std::vector<std::string> args,
63
63
const std::string& dump_stats_filter,
64
64
const std::string& resume_from_file,
65
65
argparse::ArgumentParser& resume_parser) {
66
+ auto model_config = dorado::load_crf_model_config (model_path);
67
+ std::string model_name = std::filesystem::canonical (model_path).filename ().string ();
68
+
66
69
torch::set_num_threads (1 );
67
70
68
71
if (!DataLoader::is_read_data_present (data_path, recursive_file_loading)) {
@@ -72,7 +75,11 @@ void setup(std::vector<std::string> args,
72
75
73
76
// Check sample rate of model vs data.
74
77
auto data_sample_rate = DataLoader::get_sample_rate (data_path, recursive_file_loading);
75
- auto model_sample_rate = get_model_sample_rate (model_path);
78
+ auto model_sample_rate = model_config.sample_rate ;
79
+ if (model_sample_rate < 0 ) {
80
+ // If unsuccessful, find sample rate by model name.
81
+ model_sample_rate = utils::get_sample_rate_by_model_name (model_name);
82
+ }
76
83
if (!skip_model_compatibility_check &&
77
84
!sample_rates_compatible (data_sample_rate, model_sample_rate)) {
78
85
std::stringstream err;
@@ -93,11 +100,9 @@ void setup(std::vector<std::string> args,
93
100
throw std::runtime_error (" Modified base models cannot be used with FASTQ output" );
94
101
}
95
102
96
- auto model_config = dorado::load_crf_model_config (model_path);
97
103
auto [runners, num_devices] =
98
104
create_basecall_runners (model_config, device, num_runners, 0 , batch_size, chunk_size);
99
105
100
- std::string model_name = std::filesystem::canonical (model_path).filename ().string ();
101
106
auto read_groups = DataLoader::load_read_groups (data_path, model_name, recursive_file_loading);
102
107
auto read_list = utils::load_read_list (read_list_file_path);
103
108
@@ -135,10 +140,17 @@ void setup(std::vector<std::string> args,
135
140
{read_converter}, min_qscore, default_parameters.min_sequence_length ,
136
141
std::unordered_set<std::string>{}, thread_allocations.read_filter_threads );
137
142
138
- pipelines::create_simplex_pipeline (pipeline_desc, std::move (runners), std::move (remora_runners),
139
- overlap, thread_allocations.scaler_node_threads ,
140
- thread_allocations.remora_threads * num_devices,
141
- read_filter_node);
143
+ auto mean_qscore_start_pos = model_config.mean_qscore_start_pos ;
144
+ if (mean_qscore_start_pos < 0 ) {
145
+ mean_qscore_start_pos = utils::get_mean_qscore_start_pos_by_model_name (model_name);
146
+ if (mean_qscore_start_pos < 0 ) {
147
+ throw std::runtime_error (" Mean q-score start position cannot be < 0" );
148
+ }
149
+ }
150
+ pipelines::create_simplex_pipeline (
151
+ pipeline_desc, std::move (runners), std::move (remora_runners), overlap,
152
+ mean_qscore_start_pos, thread_allocations.scaler_node_threads ,
153
+ thread_allocations.remora_threads * num_devices, read_filter_node);
142
154
143
155
// Create the Pipeline from our description.
144
156
std::vector<dorado::stats::StatsReporter> stats_reporters;
0 commit comments