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

provide the dummy data to train #119

Merged
merged 1 commit into from
Dec 12, 2023
Merged

provide the dummy data to train #119

merged 1 commit into from
Dec 12, 2023

Conversation

yezhengmao1
Copy link
Collaborator

provide the dummy data to train and test.
test the LoRA by the below code @Trilarflagz can test and modify the colab code to this? (maybe need better prompt and test instruction):

# ...
generation_config = model.generation_config
generation_config.max_new_tokens = 256
generation_config.temperature = 1
generation_config.top_p = 1
generation_config.num_return_sequences = 1
generation_config.pad_token_id = tokenizer.eos_token_id
generation_config.eos_token_id = tokenizer.eos_token_id

device = "cuda:0"
prompt = "Could you provide an introduction to m-LoRA?\n"
encoding = tokenizer(prompt, return_tensors="pt").to(device)
with torch.inference_mode():
  outputs = model.generate(
      input_ids = encoding.input_ids,
      attention_mask = encoding.attention_mask,
      generation_config = generation_config
  )

  full_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
  answer = full_text.replace(prompt, '').strip()
  print(answer)

image

Copy link
Member

@mikecovlee mikecovlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yezhengmao1 yezhengmao1 merged commit a1c0f3c into main Dec 12, 2023
7 checks passed
@yezhengmao1 yezhengmao1 deleted the dummy_data branch December 25, 2023 11:24
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