Skip to content
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

AttributeError: 'NameDataset' object has no attribute 'search_first_name' #1

Closed
Eyr3 opened this issue Jun 6, 2022 · 3 comments
Closed

Comments

@Eyr3
Copy link

Eyr3 commented Jun 6, 2022

Hello,
I am interested in your awesome work and thank you for sharing the code.
When I run finetune_baseline.sh, I get the following error:

Traceback (most recent call last):
  File "/propaganda_as_a_service/examples/pytorch/summarization/run_summarization.py", line 898, in <module>
    main()
  File "/propaganda_as_a_service/examples/pytorch/summarization/run_summarization.py", line 607, in main
    eval_attack_dataset = eval_attack_dataset.map(
  File "/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2346, in map
    return self._map_single(
  File "/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 532, in wrapper
    out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
  File "/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 499, in wrapper
    out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
  File "/.local/lib/python3.9/site-packages/datasets/fingerprint.py", line 458, in wrapper
    out = func(self, *args, **kwargs)
  File "/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2734, in _map_single
    batch = apply_function_on_filtered_inputs(
  File "/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2614, in apply_function_on_filtered_inputs
    processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
  File "/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2306, in decorated
    result = f(decorated_item, *args, **kwargs)
  File "/propaganda_as_a_service/examples/pytorch/summarization/run_summarization.py", line 576, in preprocess_attack_function
    input_ids, label_ids, _ = Seq2SeqTrainer.synthesize_backdoor_inputs(input_ids,
  File "/propaganda_as_a_service/src/transformers/utils/backdoors/backdoor_trainer.py", line 260, in synthesize_backdoor_inputs
    if args.name_search.search_first_name(word[1:]) >= 50:
AttributeError: 'NameDataset' object has no attribute 'search_first_name'

The reason may be that this attribute is no longer available in the name-dataset library.
Is the purpose of search_first_name(word[1:]) to find out how many times the word[1:] appears in args.name_search.first_names?

@ebagdasa
Copy link
Owner

ebagdasa commented Jun 6, 2022

oh, thanks for pointing out! They updated the library I guess, I updated the Readme to use names-dataset==2.0.1 can you please try whether that one still works?

@Eyr3
Copy link
Author

Eyr3 commented Jun 6, 2022

Thank you for your reply! The code works properly now.

@ebagdasa
Copy link
Owner

ebagdasa commented Jun 6, 2022

great, thank you for reporting!

@ebagdasa ebagdasa closed this as completed Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants