Skip to content

Commit 4e408b0

Browse files
committed
remove unused remove_duplicates
1 parent 94ab11f commit 4e408b0

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

model.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,26 +1949,6 @@ std::string ModelLoader::load_umt5_tokenizer_json() {
19491949
return json_str;
19501950
}
19511951

1952-
std::vector<TensorStorage> remove_duplicates(const std::vector<TensorStorage>& vec) {
1953-
std::vector<TensorStorage> res;
1954-
std::unordered_map<std::string, size_t> name_to_index_map;
1955-
1956-
for (const auto& ts : vec) {
1957-
const std::string& current_name = ts.name;
1958-
auto it = name_to_index_map.find(current_name);
1959-
1960-
if (it != name_to_index_map.end()) {
1961-
// Found a duplicate, overwrite the existing one in res
1962-
res[it->second] = ts;
1963-
} else {
1964-
// Not a duplicate, add to map and push to res
1965-
name_to_index_map[current_name] = res.size();
1966-
res.push_back(ts);
1967-
}
1968-
}
1969-
return res;
1970-
}
1971-
19721952
bool ModelLoader::load_tensors(on_new_tensor_cb_t on_new_tensor_cb, int n_threads_p) {
19731953
int64_t process_time_ms = 0;
19741954
std::atomic<int64_t> read_time_ms(0);

0 commit comments

Comments
 (0)