Coder Social home page Coder Social logo

Comments (8)

MarceloCorreiaData avatar MarceloCorreiaData commented on August 26, 2024 7

I had the same problem as you guys, so I reasoned reedcli meant with https://huggingface.co/01-ai/Yi-6B/discussions/6 they expected us to apply "trust_remote_code" to both instantiations.
So this code worked like a charm, please try it out:

from transformers import AutoTokenizer, AutoModelForCausalLM
model_path = '/path/to/your/model'
model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True, dtype="bfloat16", use_accelerate=True)
P.S.: (Add/replace your "device" snippet, I use mine).

from yi.

zl-liu avatar zl-liu commented on August 26, 2024 4

@mallorbc Thanks for your reply! I already set it to True (I even tried hard-coding "True" for "trust_remote_code"

from yi.

oobabooga avatar oobabooga commented on August 26, 2024 2

Is there any way to fix this in text-generation-webui-main for ExLlama_HF? What and where should I edit and add?

You need to launch the web UI with the --trust-remote-code flag (it is disabled by default as a security measure).

from yi.

loofahcus avatar loofahcus commented on August 26, 2024

Unfortunately I can't reproduce this problem, maybe you can have a try with our Docker image (will be released soon: #3)

from yi.

zl-liu avatar zl-liu commented on August 26, 2024

I did a deep dive into the code ---- I think this problem might be caused by loading errors in this code: [https://github.com/huggingface/transformers/blob/eef7ea98c31a333bacdc7ae7a2372bde772be8e4/src/transformers/models/auto/tokenization_auto.py] . I downloaded the Yi-34b tar file, decompressed it, and used that dir as the pretrained path.

In tokenizer_config.json:

"auto_map": {
--
  | "AutoTokenizer": ["tokenization_yi.YiTokenizer", null]
  | },

Perhaps it failed to find the YiTokenizer class?

from yi.

mallorbc avatar mallorbc commented on August 26, 2024

Run with "trust_remote_code" being set to True

from yi.

romulowspp avatar romulowspp commented on August 26, 2024

Hello! i'm receiving the same error, i also tried trust_remote_code to True and receive same error.

from yi.

DmitryVN avatar DmitryVN commented on August 26, 2024

Is there any way to fix this in text-generation-webui-main for ExLlama_HF? What and where should I edit and add?

from yi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.