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

patch 1 for mllm #298

Merged
merged 31 commits into from
Nov 12, 2024
Merged

patch 1 for mllm #298

merged 31 commits into from
Nov 12, 2024

Conversation

n1ck-guo
Copy link
Contributor

@n1ck-guo n1ck-guo commented Nov 4, 2024

TODO:

  • add support for phi3, llava and etc.
  • change default config
  • add default dataset, download from url for both dataset and images

Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
self.add_argument("--dataset", type=str, default=None,
help="the dataset for quantization training. It can be a custom one.")
self.add_argument("--dataset", type=str, default="llava_v1_5_mix665k",
help="The dataset for quantization training. It can be a custom one.")
Copy link
Contributor

Choose a reason for hiding this comment

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

use lowercase for the first letter to follow our current style

processor.chat_template = None
safe_serialization = True
if "phi3_v" in model_type:
safe_serialization = False
Copy link
Contributor

Choose a reason for hiding this comment

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

the code is tricky, better move to model config later

n1ck-guo and others added 7 commits November 7, 2024 04:29
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
n1ck-guo and others added 7 commits November 8, 2024 03:25
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
device=device_str, seed=args.seed, gradient_accumulate_steps=args.gradient_accumulate_steps,
scale_dtype=args.scale_dtype, layer_config=layer_config,
scale_dtype=args.scale_dtype, layer_config=layer_config, template=args.template,
Copy link
Contributor

Choose a reason for hiding this comment

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

rename template to prompt_template to make it more easier to understand?

Copy link
Contributor Author

@n1ck-guo n1ck-guo Nov 11, 2024

Choose a reason for hiding this comment

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

This template is more like "model series template". It include processor(text/image), data collator, and special token.

res = os.system(
f"{python_path} ../auto_round/__main__.py --model 'facebook/opt-125m' --iter 2 --nsamples 1 --format auto_gptq,auto_round --disable_eval --output_dir ./saved")
f"cd .. && {python_path} -m auto_round --mllm --iter 2 --nsamples 10 --format auto_round --output_dir ./saved")
if res > 0 or res == -1:
assert False, "cmd line test fail, please have acheck"
Copy link
Contributor

Choose a reason for hiding this comment

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

add another test for auto-round -h

@@ -44,18 +46,26 @@ def register(dataset):
return register



@register_dataset("llava")
Copy link
Contributor

Choose a reason for hiding this comment

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

better add more information like liuhaotian/llava and 58k or 150k

Signed-off-by: n1ck-guo <[email protected]>
@@ -50,8 +50,10 @@ def __init__(self, *args, **kwargs):
self.add_argument("--asym", action='store_true',
help="whether to use asym quantization")

self.add_argument("--dataset", type=str, default=None,
help="the dataset for quantization training. It can be a custom one.")
self.add_argument("--dataset", type=str, default="llava_conv_58k",
Copy link
Contributor

Choose a reason for hiding this comment

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

llava_conv_58k ==>better change to liuhaotian/llava_conv_58k

Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
@wenhuach21 wenhuach21 changed the title patch for mllm patch 1 for mllm Nov 11, 2024
@n1ck-guo n1ck-guo merged commit 73861bb into main Nov 12, 2024
12 of 14 checks passed
@n1ck-guo n1ck-guo deleted the hengguo/mllm_patch branch November 12, 2024 01:10
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.

2 participants