Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

CU-86995mmb6 Fix some RelCAT typing issues#542

Merged
mart-r merged 6 commits intomasterfrom
CU-86995mmb6-relcat-typing
May 23, 2025
Merged

CU-86995mmb6 Fix some RelCAT typing issues#542
mart-r merged 6 commits intomasterfrom
CU-86995mmb6-relcat-typing

Conversation

@mart-r
Copy link
Collaborator

@mart-r mart-r commented May 23, 2025

There were some typing issues that were resolved with this PR.

The gist of it has to do with specific models (i.e ModernBert or Llama) requiring model-specific configs isntead of the baseclass of PretrainedConfig.

Though the fix does need a cast operation, I moved all those jointly into medcat.utils.relation_extraction.models.

Though there's also casting of loaded config for each (Bert, ModernBert, Llama) due to the method signature of .from_pretrained and .from_json_file returning a PretrainedConfig rather than the specific one that it was called on. In reality, the calling class is returned anyway (since the implicit cls is initialised in both cases).

@tomolopolis
Copy link
Member

Copy link
Member

@tomolopolis tomolopolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mart-r mart-r merged commit ccbd354 into master May 23, 2025
8 checks passed
alhendrickson pushed a commit to CogStack/cogstack-nlp that referenced this pull request Jul 1, 2025
* CU-86995mmb6: Fix typing issues with modern bert config

* CU-86995mmb6: Fix issue with llama tokenizer wrapper

* CU-86995mmb6: Fix typing issues with llama config

* CU-86995mmb6: Make bert model config types explicit as well

* CU-86995mmb6: Remove excessive/unncessary type hints

* CU-86995mmb6: Remove unncessary type ignore
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants