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

Add options for more pretrained models #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vochicong
Copy link

Hi,

I'm trying PPLM with XLNet instead of GPT-2 and encountered errors regarding the output format. It seems that the GPT-2 model has 3 output values, but the XLNet model has only 2.

/content/PPLM/run_pplm.py in generate_text_pplm(model, tokenizer, context, past, device, perturb, bow_indices, classifier, class_label, loss_type, length, stepsize, temperature, top_k, sample, num_iterations, grad_length, horizon_length, window_length, decay, gamma, gm_scale, kl_scale, verbosity_level)
    594                 past = model(output_so_far[:, :-1])[1]
    595 
--> 596         unpert_logits, unpert_past, unpert_all_hidden = model(output_so_far)
    597         unpert_last_hidden = unpert_all_hidden[-1]
    598 

ValueError: not enough values to unpack (expected 3, got 2)

What should I try? Could you give me some hints?

My experimental notebook:
https://colab.research.google.com/drive/1ywRuiFMC1NTXiIpg0xTihF8ljP0W1ECS

Thank you!

image

@w4nderlust
Copy link
Collaborator

Do you know what is XLNet outputting instead of those 3 tensors?

@CLAassistant
Copy link

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

3 participants