lit-llama icon indicating copy to clipboard operation
lit-llama copied to clipboard

`generate.py` and `generate/full.py` could be merged

Open carmocca opened this issue 2 years ago • 4 comments

Proposed in https://github.com/Lightning-AI/lit-llama/pull/255

The only difference in logic is the instruction tuning. We could add a flag for it as in https://github.com/Lightning-AI/lit-llama/pull/278

carmocca avatar May 22 '23 20:05 carmocca

Hi @carmocca If possible I would like to work on this issue after going through the files and the discussions mentioned above what I can understand is as follows

  1. Remove the generate.py file and add the required changes to the generate/full.py file
  2. Add instruction tuning flag and use generate_prompt function if the flag is true
  3. I can see that generate function in generate.py is referenced in multiple scripts(finetune, evaluate & generate) it can be moved to lit_llama/utils

Let me know if these changes sound good :D

pavanpvl avatar May 28 '23 13:05 pavanpvl

That's a good point. I also wondered if we even needed a generate.py script in the top level. Like you suggest, I am in favor of having the script under generate/ similar to the finetune/ and evaluate/ scripts.

I can see that generate function in generate.py is referenced in multiple scripts(finetune, evaluate & generate) it can be moved to lit_llama/utils

Or could we just reference the respective generate/* scripts then?

rasbt avatar May 28 '23 14:05 rasbt

@rasbt Yeah this sounds good as well, I was thinking of having it under utils but it might just be a matter of preference I guess 😅

pavanpvl avatar May 28 '23 15:05 pavanpvl

@carmocca I made a PR for this issue.

Could you help to review the PR?

ruoyu61 avatar Jul 26 '23 20:07 ruoyu61