OSError: ../../../../models/Yi-VL-34B/ does not appear to have a file named preprocessor_config.json. Checkout 'https://huggingface.co/../../../../models/Yi-VL-34B//main' for available files.
Author: lucasjinreal
Pull request: no

OSError: ../../../../models/Yi-VL-34B/ does not appear to have a file named preprocessor_config.json. Checkout 'https://huggingface.co/../../../../models/Yi-VL-34B//main' for available files.

Comments:
This is because of new transformer version

Hi @lucasjinreal, thanks for raising an issue! 

Without knowing how or where the error is triggered, or the full error message there's not much we can do. So that we can be best help you, please make sure to follow the [issue template](https://github.com/huggingface/transformers/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml) and provide: 
* The running environment: run `transformers-cli env` in the terminal and copy-paste the output
* A minimal code snippet we can run to reproduce the error 
* All relevant details about the error including the full error traceback

@amyeroberts  this mode can not using AWQ to load for quantization: https://huggingface.co/01-ai/Yi-VL-34B

Hi @lucasjinreal, as noted in my previous comment, we cannot help you without knowing what code your running and on which versions of important libraries. We get many requests per day - in order for us to be able to respond in a timely manner it's necessary for you to help us. Please provide the information requested:

* The running environment: run transformers-cli env in the terminal and copy-paste the output
* A minimal code snippet we can run to reproduce the error
* All relevant details about the error including the full error traceback

@amyeroberts  Above is the model, this is the code:

```python
import argparse
import logging

from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer


def run_quantization(args):
    # Load model
    tokenizer = AutoTokenizer.from_pretrained(
        args.model, trust_remote_code=True
    )
    model = AutoAWQForCausalLM.from_pretrained(args.model)

    quant_config = {
        "zero_point": True,
        "q_group_size": args.group_size,
        "w_bit": args.bits,
    }
    # Quantize
    model.quantize(tokenizer, quant_config=quant_config)

    # Save quantized model
    model.save_quantized(args.output_dir, safetensors=True)
    tokenizer.save_pretrained(args.output_dir)


if __name__ == "__main__":
    logger = logging.getLogger()
    logging.basicConfig(
        format="%(asctime)s %(levelname)s [%(name)s] %(message)s",
        level=logging.INFO,
        datefmt="%Y-%m-%d %H:%M:%S",
    )

    parser = argparse.ArgumentParser(description="AutoAWQ quantize")
    parser.add_argument(
        "--model",
        type=str,
        default="01-ai/Yi-6b",
        help="Pretrained model path locally or name on huggingface",
    )
    parser.add_argument("--output_dir", type=str, help="Output base folder")
    parser.add_argument(
        "--trust_remote_code", action="store_true", help="Trust remote code"
    )
    parser.add_argument("--bits", type=int, default=4, help="Quantize bit(s)")
    parser.add_argument(
        "--group_size", type=int, default=128, help="Quantize group size(s)"
    )

    args = parser.parse_args()
    run_quantization(args)

```

the transformers version is 4.35.1

@lucasjinreal Can you provide the full error traceback please?

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

i have the same problem，have you solved it ?

@Bambooslp Could you provide all of the info requested in [this comment](https://github.com/huggingface/transformers/issues/28658#issuecomment-1907998582)? This will help us try and solve the issue 

Same issue... just running the example from Janus Repository 

Issue
```
 File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/transformers/utils/hub.py", line 381, in cached_files
    raise OSError(
OSError: /Users/x/DeepSeek-Janus-Pro-7B does not appear to have a file named preprocessor_config.json.
```

Code run 
```
import os
import PIL.Image
import torch
import numpy as np
import sys
from transformers import AutoModelForCausalLM
from janus.models import MultiModalityCausalLM, VLChatProcessor


# specify the path to the model
model_path = "PATHTOMODEL"
vl_chat_processor: VLChatProcessor = VLChatProcessor.from_pretrained(model_path)
tokenizer = vl_chat_processor.tokenizer

vl_gpt: MultiModalityCausalLM = AutoModelForCausalLM.from_pretrained(
    model_path, trust_remote_code=True
)
vl_gpt = vl_gpt.to(torch.bfloat16).cuda().eval()

conversation = [
    {
        "role": "User",
        "content": "A stunning princess from kabul in red, white traditional clothing, blue eyes, brown hair",
    },
    {"role": "Assistant", "content": ""},
]

sft_format = vl_chat_processor.apply_sft_template_for_multi_turn_prompts(
    conversations=conversation,
    sft_format=vl_chat_processor.sft_format,
    system_prompt="",
)
prompt = sft_format + vl_chat_processor.image_start_tag


@torch.inference_mode()
def generate(
    mmgpt: MultiModalityCausalLM,
    vl_chat_processor: VLChatProcessor,
    prompt: str,
    temperature: float = 1,
    parallel_size: int = 16,
    cfg_weight: float = 5,
    image_token_num_per_image: int = 576,
    img_size: int = 384,
    patch_size: int = 16,
):
    input_ids = vl_chat_processor.tokenizer.encode(prompt)
    input_ids = torch.LongTensor(input_ids)

    tokens = torch.zeros((parallel_size*2, len(input_ids)), dtype=torch.int).cuda()
    for i in range(parallel_size*2):
        tokens[i, :] = input_ids
        if i % 2 != 0:
            tokens[i, 1:-1] = vl_chat_processor.pad_id

    inputs_embeds = mmgpt.language_model.get_input_embeddings()(tokens)

    generated_tokens = torch.zeros((parallel_size, image_token_num_per_image), dtype=torch.int).cuda()

    for i in range(image_token_num_per_image):
        outputs = mmgpt.language_model.model(inputs_embeds=inputs_embeds, use_cache=True, past_key_values=outputs.past_key_values if i != 0 else None)
        hidden_states = outputs.last_hidden_state
        
        logits = mmgpt.gen_head(hidden_states[:, -1, :])
        logit_cond = logits[0::2, :]
        logit_uncond = logits[1::2, :]
        
        logits = logit_uncond + cfg_weight * (logit_cond-logit_uncond)
        probs = torch.softmax(logits / temperature, dim=-1)

        next_token = torch.multinomial(probs, num_samples=1)
        generated_tokens[:, i] = next_token.squeeze(dim=-1)

        next_token = torch.cat([next_token.unsqueeze(dim=1), next_token.unsqueeze(dim=1)], dim=1).view(-1)
        img_embeds = mmgpt.prepare_gen_img_embeds(next_token)
        inputs_embeds = img_embeds.unsqueeze(dim=1)


    dec = mmgpt.gen_vision_model.decode_code(generated_tokens.to(dtype=torch.int), shape=[parallel_size, 8, img_size//patch_size, img_size//patch_size])
    dec = dec.to(torch.float32).cpu().numpy().transpose(0, 2, 3, 1)

    dec = np.clip((dec + 1) / 2 * 255, 0, 255)

    visual_img = np.zeros((parallel_size, img_size, img_size, 3), dtype=np.uint8)
    visual_img[:, :, :] = dec

    os.makedirs('generated_samples', exist_ok=True)
    for i in range(parallel_size):
        save_path = os.path.join('generated_samples', "img_{}.jpg".format(i))
        PIL.Image.fromarray(visual_img[i]).save(save_path)


generate(
    vl_gpt,
    vl_chat_processor,
    prompt,
)
```