Merged
Conversation
voorhs
requested changes
May 17, 2025
Samoed
reviewed
May 17, 2025
| verbose: bool = False, | ||
| **catboost_kwargs: Any, # noqa: ANN401 | ||
| ) -> None: | ||
| self.classification_model_config = EmbedderConfig.from_search_config(classification_model_config) |
Member
There was a problem hiding this comment.
Если classification_model_config None, то создастся EmbedderConfig с дефолтными значениями. У тебя тест test_catboost_without_embedder получается не то тестирует
Samoed
reviewed
May 17, 2025
|
|
||
| def encode(texts: list[str]) -> npt.NDArray[np.float32]: | ||
| with torch.no_grad(): | ||
| batch = tokenizer( |
Member
There was a problem hiding this comment.
У EmbedderConfig есть параметры для токенизации в tokenizer_config
Samoed
requested changes
May 17, 2025
Comment on lines
172
to
177
|
|
||
| def _init_text_tools(self) -> None: | ||
| if not hasattr(self, "_tokenizer"): | ||
| self._tokenizer = Tokenizer(lowercasing=True, separator_type="BySense", token_types=["Word", "Number"]) | ||
| if not hasattr(self, "_dictionary"): | ||
| self._dictionary = Dictionary(occurence_lower_bound=1, gram_order=1) |
Comment on lines
210
to
214
| y_mat = np.zeros((len(labels), self._n_classes), dtype=np.float32) | ||
| for i, lbls in enumerate(cast("Sequence[Sequence[int]]", labels)): | ||
| for class_i, lbl in enumerate(lbls): | ||
| y_mat[i, class_i] = lbl | ||
| y = y_mat |
Member
There was a problem hiding this comment.
Можно просто заменить на np.asarray(labels)?
Samoed
reviewed
May 21, 2025
| self._dictionary_fitted = False | ||
|
|
||
| def get_embedder_config(self) -> dict[str, Any]: | ||
| return self.embedder_config.model_dump() |
Member
There was a problem hiding this comment.
Если self._use_embedder False, то ошибка будет
Samoed
reviewed
May 21, 2025
Comment on lines
123
to
128
| if not hasattr(self, "_tokenizer"): | ||
| self._tokenizer = Tokenizer(lowercasing=True, separator_type="BySense", token_types=["Word", "Number"]) | ||
| if not hasattr(self, "_dictionary"): | ||
| self._dictionary = Dictionary(occurence_lower_bound=1, gram_order=1) | ||
| if not hasattr(self, "_dictionary_fitted"): | ||
| self._dictionary_fitted = False |
Member
There was a problem hiding this comment.
Надо сделать как-то задаваемым как так? https://catboost.ai/docs/en/references/text-processing__test-processing__default-value
Просто кажется что можно не указывать tokenizer, dictironary и тд
* fix * sklearn scorer proper name * fix typing errors * try to fix pydantic errors
* Update wandb.py * Update wandb.py * Update wandb.py * Update _optimization_info.py * remove print
* fix few shot split * lint
* change how `clear_cache` is called * first version of early stopping * change mypy version * train_test_split bug fix * add `compute_metrics` and `EarlyStoppingCallback` * bug fix * fix mypy * try to fix `"eval_f1" not found` error * forgot to upd `from_context` * try to fix mypy * ty to fix "not found f1" error * refactor a little bit * disable early stopping for lora * fix typing errors * update contributing and makefile * minor change * use our metrics * add docstrings * set 3.10 for mypy * upd contributing.md * try to fix bug * try to fix typing issue * try to fix * add early stopping to ptuning
* add test for configuration * lint * satisfy mypy
* add prompt logging * Update optimizer_config.schema.json * fix --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix default prompt * allow to use default prompt with override
Samoed
approved these changes
Jun 14, 2025
# Conflicts: # autointent/modules/scoring/_catboost/catboost_scorer.py # tests/modules/scoring/test_catboost.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
В
catboost_scorer.pyдобавилdumpиloadдля CatBoostScorer. После можно будет их отредактировать и взять в_dump_tools