-
Notifications
You must be signed in to change notification settings - Fork 79
feat: add generative recommendation tokenizer. #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| std::lock_guard<std::mutex> lock(instance_map_mutex_); | ||
|
|
||
| auto it = instance_map_.find(version); | ||
| if (it == instance_map_.end()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need to find twice from instance_map_? Line25 above has already do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double-checked locking, it is better to change std::mutex to std::shared_mutex
| } | ||
|
|
||
| bool RecVocabDict::get_items_by_tokens(const RecTokenTriple& rec_token_triple, | ||
| std::vector<int64_t>* item_ids) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe use & here is better.
std::vector<int64_t>* item_ids -> const std::vector<int64_t>& item_ids
CHECK(!item_ids.empty());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the latter method is better, but the interface in front is the former method, so we used it
|
|
||
| /** | ||
| * @brief initialize instance, parse vocab file | ||
| * @param vocab_file vocab file, need full path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe we can align the comment format.
// @brief initialize instance, parse vocab file
// @param vocab_file vocab file, need full path
// ...
| std::sort(model_weights_files_.begin(), model_weights_files_.end()); | ||
|
|
||
| //@todo: 'false' will be replaced with generative recommendation judgment | ||
| if (false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it doesn't work yet, shouldn't add this logic for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only send out the review in advance, will not merge now, and will be modified when merging the main process code of the generative recommendation.
No description provided.