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

The trained LLaMA-MLP-MoE (2/8) cannot generate the correct output #5

Open
cnlinxi opened this issue Jan 20, 2025 · 2 comments
Open

Comments

@cnlinxi
Copy link

cnlinxi commented Jan 20, 2025

Hello authors. I tried to train LLaMA-MLP-MoE (2/8). After two stages of training, the model cannot output normal sentences. The inference script is as follows:

model_dir = ""
tokenizer = AutoTokenizer.from_pretrained(model_dir, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_dir, torch_dtype=torch.bfloat16, trust_remote_code=True)
model.eval()
model.cuda()

input_text = "Could you recommend me some mystery novels?"
input_text = f"<|start_header_id|>user<|end_header_id|>\n\n{input_text}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
inputs = tokenizer(input_text, return_tensors="pt")
input_ids = inputs["input_ids"].cuda()

pred = model.generate(input_ids, max_length=200, temperature=1.0, do_sample=True, use_cache=True)
print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True))

The output is:

Could you recommend me some mystery novels?assistant

 to.The old answer and you, can的 is a, ),2 and,的 is is as。 the : for2 to in the is of the as。  we and "). the.

, of1 a for and is is you,,).

 a is on: in and a1, : with that    ( of. the    of to of and to to for the2 of. and =) of

Where the error occurred?

Thank you for your reply

@cnlinxi
Copy link
Author

cnlinxi commented Jan 21, 2025

@cnlinxi
Copy link
Author

cnlinxi commented Jan 21, 2025

By the way, can you show the training loss and trend?
The loss I tried was always around 7.8 during second stage and could not be reduced.
Thank you for your reply.

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

No branches or pull requests

1 participant