Comments (3)
Its not that ugly ... but no reason to call get_hf_objects
twice :).
Checkout out the docs here, in particular the multi-label example. You'll see something like this which is a bit more efficient:
task = HF_TASKS_AUTO.SequenceClassification
pretrained_model_name = "roberta-base" # "distilbert-base-uncased" "bert-base-uncased"
config = AutoConfig.from_pretrained(pretrained_model_name)
config.num_labels = len(lbl_cols)
hf_arch, hf_config, hf_tokenizer, hf_model = BLURR_MODEL_HELPER.get_hf_objects(pretrained_model_name,
task=task,
config=config)
from blurr.
I'm now using a very ugly way 😢 please help me
hf_arch, hf_config, hf_tokenizer, hf_model = BLURR_MODEL_HELPER.get_hf_objects(
pretrained_model_name, task=task
)
hf_config.num_labels = num_labels
hf_arch, hf_config, hf_tokenizer, hf_model = BLURR_MODEL_HELPER.get_hf_objects(
pretrained_model_name, task=task, config=hf_config
)
from blurr.
Thanks a lot! That's faster and simpler.
from blurr.
Related Issues (20)
- `PreCalculatedMSELoss()` raises `TypeError` HOT 1
- blurr Translation High Level API broken HOT 3
- Dead? Will vision transformers come? Last commit 2 years ago HOT 2
- Fine-Tuning the BART Large Model for Text Summarization NOT RUNNING HOT 3
- HF_Seq2SeqBeforeBatchTransform is not defined HOT 2
- BlearnerForSequenceClassification for multiclass text classification using mBert HOT 4
- summarisation output length HOT 1
- TPU usage HOT 1
- Summarization failed when using t5 HOT 1
- EncoderDecoderModel with BERT HOT 1
- Resuming training HOT 2
- How to save and load the pretrained model to local?
- Out of memory errors with Keras models
- Multi-Label Classification Problem HOT 1
- Problem with the DataBlock creation for MLM HOT 4
- Getting issue with dblock = DataBlock( blocks=blocks, get_x=ColReader("text"), get_y=ColReader("label"), splitter=ColSplitter() ) HOT 1
- BlearnerForSummarization with t5-base errors out 'function' object has no attribute 'setup' HOT 1
- Issues with blurr_summarize returning the error 'BartConfig' object has no attribute 'exponential_decay_length_penalty'
- pretrained=false
- Error due to tok_kwargs setting for Hindi Language
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 blurr.