prakhar21 / textaugmentation-gpt2 Goto Github PK
View Code? Open in Web Editor NEWFine-tuned pre-trained GPT2 for custom topic specific text generation. Such system can be used for Text Augmentation.
License: MIT License
Fine-tuned pre-trained GPT2 for custom topic specific text generation. Such system can be used for Text Augmentation.
License: MIT License
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?
I wanna predict sentences without calling generate function multiple times.
请问作者方便把数据集发给我吗。麻烦啦
Does this works with Chinese text corpus? Thanks!
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
NameError: name 'device' is not defined ?How can I solve it, thank you
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
I am afraid that the value n in 'generate.py' line 44 and line 46 is not been used. Could you help? Thanks.
Apologies. Wrong post and I've closed the issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.