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

Train without Persona #19

Open
nikhiljaiswal opened this issue Jul 31, 2019 · 4 comments
Open

Train without Persona #19

nikhiljaiswal opened this issue Jul 31, 2019 · 4 comments

Comments

@nikhiljaiswal
Copy link

Hi,
Has anyone managed to train without persona taking into account only the context information?

@wise-east
Copy link

wise-east commented Sep 16, 2019

Just change the data so that personality is "" and comment out:
# persona = [persona[-1]] + persona[:-1] # permuted personalities

@dimeldo
Copy link

dimeldo commented Oct 12, 2019

  1. You mean the "personality" key data should look like: "personality": [""]
  2. What's the value of personality_permutations should be?

@wise-east @sshleifer

@chetnakhanna16
Copy link

Any luck in training this model without persona? I tried to do as @wise-east mentioned but getting the following error.

ERROR:ignite.engine.engine.Engine:Current run is terminating due to exception: can't multiply sequence by non-int of type 'float'
ERROR:ignite.engine.engine.Engine:Engine run is terminating due to exception: can't multiply sequence by non-int of type 'float'
Traceback (most recent call last):
  File "train.py", line 267, in <module>
    train()
  File "train.py", line 259, in train
    trainer.run(train_loader, max_epochs=args.n_epochs)
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 702, in run
    return self._internal_run()
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 775, in _internal_run
    self._handle_exception(e)
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 469, in _handle_exception
    raise e
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 745, in _internal_run
    time_taken = self._run_once_on_dataset()
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 850, in _run_once_on_dataset
    self._handle_exception(e)
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 469, in _handle_exception
    raise e
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 833, in _run_once_on_dataset
    self.state.output = self._process_function(self, self.state.batch)
  File "train.py", line 182, in update
    loss = (lm_loss * args.lm_coef + mc_loss * args.mc_coef) / args.gradient_accumulation_steps
TypeError: can't multiply sequence by non-int of type 'float'


@tjtanjin
Copy link

Any luck in training this model without persona? I tried to do as @wise-east mentioned but getting the following error.

ERROR:ignite.engine.engine.Engine:Current run is terminating due to exception: can't multiply sequence by non-int of type 'float'
ERROR:ignite.engine.engine.Engine:Engine run is terminating due to exception: can't multiply sequence by non-int of type 'float'
Traceback (most recent call last):
  File "train.py", line 267, in <module>
    train()
  File "train.py", line 259, in train
    trainer.run(train_loader, max_epochs=args.n_epochs)
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 702, in run
    return self._internal_run()
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 775, in _internal_run
    self._handle_exception(e)
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 469, in _handle_exception
    raise e
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 745, in _internal_run
    time_taken = self._run_once_on_dataset()
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 850, in _run_once_on_dataset
    self._handle_exception(e)
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 469, in _handle_exception
    raise e
  File "/Users/ankurrastogi/opt/anaconda3/lib/python3.7/site-packages/ignite/engine/engine.py", line 833, in _run_once_on_dataset
    self.state.output = self._process_function(self, self.state.batch)
  File "train.py", line 182, in update
    loss = (lm_loss * args.lm_coef + mc_loss * args.mc_coef) / args.gradient_accumulation_steps
TypeError: can't multiply sequence by non-int of type 'float'

For anyone who may bump into this issue in future, I resolved it by adding .values() for the following line in train.py:

(lm_loss), (mc_loss), *_ = model(
        input_ids, token_type_ids=token_type_ids, mc_token_ids=mc_token_ids,
        mc_labels=mc_labels, labels=labels
).values()

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

5 participants