Giter Site home page Giter Site logo

prakhar21 / textaugmentation-gpt2 Goto Github PK

View Code? Open in Web Editor NEW
187.0 7.0 43.0 671 KB

Fine-tuned pre-trained GPT2 for custom topic specific text generation. Such system can be used for Text Augmentation.

License: MIT License

Python 100.00%
gpt-2 nlp-machine-learning transformer-architecture text-augmentation natural-language-processing natural-language-generation textclassification

textaugmentation-gpt2's Issues

Multi label

Thank you for your sharing.I've been studying your code.
Now I want it use on multi-label,but I found your code and examples is on a single label.
If I want to use it on multi-label,how should I modify it?

数据集

请问作者方便把数据集发给我吗。麻烦啦

Facing issue in generate.py


RuntimeError Traceback (most recent call last)
in
93 TOKENIZER, MODEL = load_models(MODEL_NAME)
94
---> 95 generate(TOKENIZER, MODEL, SENTENCES, LABEL, DEVICE)

in generate(tokenizer, model, sentences, label, device)
47
48 next_token_id = choose_from_top_k_top_n(softmax_logits.to('cpu').numpy()) #top-k-top-n sampling
---> 49 cur_ids = torch.cat([cur_ids, torch.ones((1,1)).long().to(device) * next_token_id], dim = 1)
50
51 if next_token_id in tokenizer.encode('<|endoftext|>'):

RuntimeError: All input tensors must be on the same device. Received cpu and cuda:0

I am facing issues in train.py and also in generate.py

Can you please reply back so that I can discuss the problems I am facing.

train.py --> model = model.to(device) --> Error: name model is not defined
generated.py --> for pre-trained model I am getting issues for mismatch and checkpoints

Regards

n is not been used

I am afraid that the value n in 'generate.py' line 44 and line 46 is not been used. Could you help? Thanks.

Removed

Apologies. Wrong post and I've closed the issue.

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.