Comments (5)
https://huggingface.co/monologg/bert-base-cased-goemotions-ekman
https://huggingface.co/monologg/bert-base-cased-goemotions-group
https://huggingface.co/monologg/bert-base-cased-goemotions-original
Please see List all files in model
in pages above.
from goemotions-pytorch.
I tried to download all the files and use it for prediction as shown in your github readme. It is showing me
UnicodeDecodeError : 'utf-8' codec can't decode byte : invalid continuation byte. Please let me know how to fix this.
from goemotions-pytorch.
I tried to download all the files and use it for prediction as shown in your github readme. It is showing me
UnicodeDecodeError : 'utf-8' codec can't decode byte : invalid continuation byte. Please let me know how to fix this.
First of all, you don't have to download the files manually. If you run the code below, all the files will be downloaded automatically from huggingface s3
from transformers import BertTokenizer
from model import BertForMultiLabelClassification
from multilabel_pipeline import MultiLabelPipeline
from pprint import pprint
tokenizer = BertTokenizer.from_pretrained("monologg/bert-base-cased-goemotions-original")
model = BertForMultiLabelClassification.from_pretrained("monologg/bert-base-cased-goemotions-original")
goemotions = MultiLabelPipeline(
model=model,
tokenizer=tokenizer,
threshold=0.3
)
texts = [
"Hey that's a thought! Maybe we need [NAME] to be the celebrity vaccine endorsement!",
"itβs happened before?! love my hometown of beautiful new ken ππ",
"I love you, brother.",
"Troll, bro. They know they're saying stupid shit. The motherfucker does nothing but stink up libertarian subs talking shit",
]
pprint(goemotions(texts))
Plz run this code and write all the logs you got:)
from goemotions-pytorch.
from goemotions-pytorch.
I can't infer the reason only based on the one line of the log that you gave. (UnicodeDecodeError : 'utf-8' codec can't decode byte : invalid continuation byte
)
You should give all the log from console.
What I can only guess is that you might not save the file (vocab.txt
etc) in utf-8 format.
Can you check the encoding of the files?
from goemotions-pytorch.
Related Issues (11)
- SindicaAI deployment
- text input is too long,RuntimeError: index out of range?
- Tokenizer and Model loading for a fine-tuned model
- Fine tuning on custom number of classes
- faster prediction using GoEmotions-pytorch models based on bert-mini, bert-small or bert-tiny HOT 1
- Sigmoid or Softmax missing in evaluation HOT 5
- How to get hidden representations of sentence
- TypeError: Can't instantiate abstract class MultiLabelPipeline with abstract methods _forward, _sanitize_parameters, postprocess, preprocess HOT 5
- Cudaλ₯Ό μλͺ»μ°Ύλκ²½μ°
- Model not running on GPU & out of memory error
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 goemotions-pytorch.