-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support using cached data and re-splitting for huggingface datasets #302
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0df2b4e
support using cached data for huggingface datasets; and re-splitting …
yxdyc 2acbeb4
support using cached data for huggingface datasets; and re-splitting …
yxdyc f796bd8
Merge remote-tracking branch 'upstream/master' into Feature/dataset_e…
yxdyc 795da26
minor fix according to weirui's comments
yxdyc d2056dd
minor fix for unittest
yxdyc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
federatedscope/nlp/baseline/fedavg_transformer_on_cola.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# different from federatedscope/nlp/baseline/fedavg_bert_on_sst2.yaml, | ||
# this yaml demonstrate | ||
# (1) using cached tokenizer via `load_disk_dir` and `hg_cache_dir` | ||
# (2) using some GLUE validation data as partial test data of the FL version | ||
|
||
use_gpu: True | ||
device: -1 | ||
early_stop: | ||
patience: 5 | ||
seed: 1 | ||
federate: | ||
mode: standalone | ||
total_round_num: 500 | ||
client_num: 50 | ||
sample_client_rate: 0.2 | ||
unseen_clients_rate: 0.2 | ||
data: | ||
root: 'glue' | ||
type: 'cola@huggingface_datasets' | ||
args: [{'load_disk_dir': 'huggingface/datasets/glue/cola', | ||
'hg_cache_dir': 'huggingface', 'max_len': 128, | ||
'val_as_dummy_test': True, 'part_train_dummy_val': 0.2} ] | ||
batch_size: 64 | ||
splitter: 'lda' | ||
splitter_args: [ { 'alpha': 0.4, 'min_size': 1} ] | ||
num_workers: 0 | ||
model: | ||
type: 'google/bert_uncased_L-2_H-128_A-2@transformers' | ||
task: 'SequenceClassification' | ||
out_channels: 2 | ||
train: | ||
local_update_steps: 1 | ||
batch_or_epoch: epoch | ||
optimizer: | ||
lr: 0.1 | ||
weight_decay: 0.0 | ||
criterion: | ||
type: CrossEntropyLoss | ||
trainer: | ||
type: nlptrainer | ||
eval: | ||
freq: 5 | ||
metrics: ['acc', 'correct', 'f1'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need a try here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of the cached file not existed