We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
After python demo.py was created dir models/output_model/GPT2.1e-05.64.0gpu.2020-07-19022953/GP2-pretrain-step-10000.pkl
python demo.py
models/output_model/GPT2.1e-05.64.0gpu.2020-07-19022953/GP2-pretrain-step-10000.pkl
Question: How create simple interactive program to use GP2-pretrain-step-10000.pk.
Something like on:
https://huggingface.co/microsoft/DialoGPT-small
`from transformers import AutoModelWithLMHead, AutoTokenizer import torch
tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-small") model = AutoModelWithLMHead.from_pretrained("microsoft/DialoGPT-small") for step in range(5): new_user_input_ids = tokenizer.encode(input(">> User:") + tokenizer.eos_token, return_tensors='pt') bot_input_ids = torch.cat([chat_history_ids, new_user_input_ids], dim=-1) if step > 0 else new_user_input_ids chat_history_ids = model.generate(bot_input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id) print("DialoGPT: {}".format(tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)))`
The text was updated successfully, but these errors were encountered:
@remotejob Hi, I am curious about the same thing. Did you find any help on this yet?
Thanks
Sorry, something went wrong.
No branches or pull requests
After
python demo.py
was created dirmodels/output_model/GPT2.1e-05.64.0gpu.2020-07-19022953/GP2-pretrain-step-10000.pkl
Question: How create simple interactive program to use GP2-pretrain-step-10000.pk.
Something like on:
https://huggingface.co/microsoft/DialoGPT-small
`from transformers import AutoModelWithLMHead, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-small")
model = AutoModelWithLMHead.from_pretrained("microsoft/DialoGPT-small")
for step in range(5):
new_user_input_ids = tokenizer.encode(input(">> User:") + tokenizer.eos_token, return_tensors='pt')
bot_input_ids = torch.cat([chat_history_ids, new_user_input_ids], dim=-1) if step > 0 else new_user_input_ids
chat_history_ids = model.generate(bot_input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id)
print("DialoGPT: {}".format(tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)))`
The text was updated successfully, but these errors were encountered: