Skip to content

Add options for more pretrained models#7

Open
vochicong wants to merge 1 commit intouber-research:masterfrom
vochicong:more-pretrained-models
Open

Add options for more pretrained models#7
vochicong wants to merge 1 commit intouber-research:masterfrom
vochicong:more-pretrained-models

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

@dathath dathath requested a review from w4nderlust February 28, 2020 02:46
@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