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

Samples #40

Open
wants to merge 8 commits into
base: inference
Choose a base branch
from
Open

Samples #40

wants to merge 8 commits into from

Commits on May 24, 2024

  1. Fix the error when passing load_4bit=True to load_pretrained_model

    When load_4bit=True is passed to load_pretrained_model(), we get the
    following error:
      File "LLaVA-NeXT/scripts/image/./gradio-ui.py", line 30, in load_model
        tokenizer, model, image_processor, max_length = load_pretrained_model(
                                                        ^^^^^^^^^^^^^^^^^^^^^^
      File "LLaVA-NeXT/llava/model/builder.py", line 175, in load_pretrained_model
        model = LlavaLlamaForCausalLM.from_pretrained(model_path, low_cpu_mem_usage=True, attn_implementation=attn_implementation, config=llava_cfg, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "LLaVA-NeXT/venv/lib/python3.12/site-packages/transformers/modeling_utils.py", line 2977, in from_pretrained
        raise ValueError(
    ValueError: You can't pass `load_in_4bit`or `load_in_8bit` as a kwarg when passing `quantization_config` argument at the same time.
    
    This commit fixes this by removing the "load_in_4bit" kwarg and relying
    on the quantization_config only.
    
    Signed-off-by: Alastair D'Silva <[email protected]>
    deece committed May 24, 2024
    Configuration menu
    Copy the full SHA
    e0d6a2b View commit details
    Browse the repository at this point in the history
  2. Add the sample script from the docs

    Signed-off-by: Alastair D'Silva <[email protected]>
    deece committed May 24, 2024
    Configuration menu
    Copy the full SHA
    b449a0c View commit details
    Browse the repository at this point in the history

Commits on May 26, 2024

  1. Don't pin bits and bytes, this old version won't cache 4-bit conversions

    Error: You are calling `save_pretrained` to a 4-bit converted model, but your `bitsandbytes` version doesn't support it. If you want to save 4-bit models, make sure to have `bitsandbytes>=0.41.3` installed.
    
    Signed-off-by: Alastair D'Silva <[email protected]>
    deece committed May 26, 2024
    Configuration menu
    Copy the full SHA
    b71b9bf View commit details
    Browse the repository at this point in the history
  2. No need to pin gradio version

    Signed-off-by: Alastair D'Silva <[email protected]>
    deece committed May 26, 2024
    Configuration menu
    Copy the full SHA
    6cb8267 View commit details
    Browse the repository at this point in the history
  3. Pinning torch versions prevents installation on Python 3.12

    Signed-off-by: Alastair D'Silva <[email protected]>
    deece committed May 26, 2024
    Configuration menu
    Copy the full SHA
    2cfab9c View commit details
    Browse the repository at this point in the history
  4. Ignore venv subdir (for Python virtual environments)

    Signed-off-by: Alastair D'Silva <[email protected]>
    deece committed May 26, 2024
    Configuration menu
    Copy the full SHA
    c43cbad View commit details
    Browse the repository at this point in the history
  5. Don't clobber kwargs in load_pretrained_model

    Signed-off-by: Alastair D'Silva <[email protected]>
    deece committed May 26, 2024
    Configuration menu
    Copy the full SHA
    0dc4977 View commit details
    Browse the repository at this point in the history
  6. Add a sample Gradio UI

    Signed-off-by: Alastair D'Silva <[email protected]>
    deece committed May 26, 2024
    Configuration menu
    Copy the full SHA
    2194392 View commit details
    Browse the repository at this point in the history