Giter Site home page Giter Site logo

Comments (6)

valsworthen avatar valsworthen commented on May 1, 2024

In the run_squad.pyscript, I added the following lines after the training loop:

logger.info(***** Saving fine-tuned model *****)
output_model_file = os.path.join(args.output_dir, "pytorch_model.bin")
if n_gpu > 1:
    torch.save(model.module.bert.state_dict(), output_model_file)
else:
    torch.save(model.bert.state_dict(), output_model_file)

The code runs and I was able to load the model to test on the Adversarial SQuAD datasets.

I do not use the other run_* scripts but this may be applicable as well.

Edit: the files have been modified in the latest commits so I think it's now necessary to check the loading of fine-tuned models in the script.

from transformers.

thomwolf avatar thomwolf commented on May 1, 2024

You are right this argument was not used. I removed it, thanks. These examples are provided as starting point to write training scripts for the package module. I don't plan to update them any further (except fixing bugs).

from transformers.

Jasperty avatar Jasperty commented on May 1, 2024

In the run_squad.pyscript, I added the following lines after the training loop:

logger.info(***** Saving fine-tuned model *****)
output_model_file = os.path.join(args.output_dir, "pytorch_model.bin")
if n_gpu > 1:
    torch.save(model.module.bert.state_dict(), output_model_file)
else:
    torch.save(model.bert.state_dict(), output_model_file)

The code runs and I was able to load the model to test on the Adversarial SQuAD datasets.

I do not use the other run_* scripts but this may be applicable as well.

Edit: the files have been modified in the latest commits so I think it's now necessary to check the loading of fine-tuned models in the script.

what is your result on adversarial-squad?

from transformers.

valsworthen avatar valsworthen commented on May 1, 2024

At that time I got:
AddSent
BERT base 58.7 EM / 66.2 F1
BERT large 65.5 EM / 71.9 F1

AddOneSent
BERT base 67.0 EM / 74.7 F1
BERT large 72.7 EM / 79.1 F1

from transformers.

Jasperty avatar Jasperty commented on May 1, 2024

At that time I got:
AddSent
BERT base 58.7 EM / 66.2 F1
BERT large 65.5 EM / 71.9 F1

AddOneSent
BERT base 67.0 EM / 74.7 F1
BERT large 72.7 EM / 79.1 F1

Thanks a lot! Do you release your paper? i want to cite your result and paper in my paper.

from transformers.

valsworthen avatar valsworthen commented on May 1, 2024

Unfortunately it was not part of a paper, just preliminary results.

from transformers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.