Comments (1)
The model weights include a classifier layer with three labels. That is why you get an error. You need to replace that last layer.
You should probably do something like the following:
finbert_without_classifier_head = AutoModel.from_pretrained("/home/pratik/finbert")
finbert_without_classifier_head.save_pretrained("/home/pratik/finbert_wch")
finbert_twoforty = AutoModelForSequenceClassification.from_pretrained("/home/pratik/finbert_wch", num_labels = 240)
from finbert.
Related Issues (20)
- Error when calling finbert.train() HOT 1
- Where is the config.json for Sentiment analysis model trained on Financial PhraseBank HOT 1
- Error in _read_tsv when trying to read in the data HOT 3
- Preprocessing using TRC2
- AxisError when call predict via REST API on Flask HOT 2
- pip install transformers is necessary to Dockerfile HOT 1
- error using predict.py HOT 4
- no code for FiQA sentiment classification task? HOT 1
- ad Gateway for url: https://huggingface.co/bert-base-uncased/resolve/main/config.json
- Sentence Representation Layer
- unable to parse tokenizer_config.json HOT 1
- TypeError: ord() expected a character, but string of length 69 found HOT 1
- pretrained model assignment HOT 1
- Understanding the output HOT 3
- Incorrect prediction Using Huggingface Transformers converted to ONNX format HOT 1
- Questions about regression HOT 1
- Tokenizer HOT 2
- Size of training data
- Is Pretrained only FinBert available HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from finbert.