question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

__version__ attribute missing in mode config.

See original GitHub issue

https://github.com/UKPLab/sentence-transformers/blob/43e89d9d974478b85b8ef3c73006f177df64dd9c/sentence_transformers/SentenceTransformer.py#L73

I’m trying to load a model that I trained from scratch, and it appears that the SentenceTransformer.py code above is requesting a field __version__ in the model config that doesn’t appear to be there.

I haven’t looked too deeply, but in case it matters, this is a RoBERTa large NLI model (I notice in the Bert-base model I trained it’s also missing).

Also, thanks for such a great toolkit!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
nreimerscommented, Apr 1, 2020

Hi @yakazimir if you want to use your own, custom BERT model, you must load it via:

# Use BERT for mapping tokens to embeddings
word_embedding_model = models.BERT('path/to/your/bert/model')

# Apply mean pooling to get one fixed sized sentence vector
pooling_model = models.Pooling(word_embedding_model.get_word_embedding_dimension(),
                               pooling_mode_mean_tokens=True,
                               pooling_mode_cls_token=False,
                               pooling_mode_max_tokens=False)

model = SentenceTransformer(modules=[word_embedding_model, pooling_model])

Best Nils Reimers

0reactions
hwakingcommented, Oct 11, 2022

邮件已收到!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"The attribute 'connectionStringName' is missing or empty." in ...
config file and I don't understand what it means: Parser Error Message: The attribute 'connectionStringName' is missing or empty. Line 24: < ...
Read more >
Known issues for application provisioning in Azure Active ...
Extensions to your schema can sometimes be missing from the source attribute dropdown in the UI. Go into the advanced settings of your...
Read more >
AD Attribute Editor tab missing – Make search visible
The Attribute Editor tab is missing, when you search a user object and open it. △ Activate the AD Attribute Editor step by...
Read more >
Attributes — conan 1.53.0 documentation
The version attribute will define the version part of the package ... among Conan recipes is to distinguish binaries by the following four...
Read more >
Building applications with Maven - Quarkus
The version currently recommended by the Quarkus Extension Registry ... This works too for resource files like the configuration property file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found