Giter Club home page Giter Club logo

Comments (9)

pseudotensor avatar pseudotensor commented on June 12, 2024

It works OOTB in newer h2ogpt. Uses chat template with end of turn stopping added.

from h2ogpt.

slavag avatar slavag commented on June 12, 2024

@pseudotensor Thanks, can you please elaborate more, as I'm not fully understand :) Sorry

from h2ogpt.

pseudotensor avatar pseudotensor commented on June 12, 2024

e.g. this is sufficient:

python generate.py --base_model=meta-llama/Meta-Llama-3-8B-Instruct

It uses the chat template that is in the HF model repo. This doesn't have a system prompt, so we add that as a pre-conversation.

from h2ogpt.

slavag avatar slavag commented on June 12, 2024

@pseudotensor Thanks, but if I'm using GGUF version, this not happens.

from h2ogpt.

pseudotensor avatar pseudotensor commented on June 12, 2024

llama-3 prompting is tricky and so to ensure it is done right, please use latest h2oGPT as of the recent merge and run:

python generate.py --base_model=llama --model_path_llama=https://huggingface.co/QuantFactory/Meta-Llama-3-8B-Instruct-GGUF/resolve/main/Meta-Llama-3-8B-Instruct.Q5_K_M.gguf?download=true --tokenizer_base_model=meta-llama/Meta-Llama-3-8B-Instruct --max_seq_len=8192

from h2ogpt.

slavag avatar slavag commented on June 12, 2024

@pseudotensor Thanks, using the latest code and example you provided, it's working fine, can you just provide a bit more details on from where model prompt template is taken in that case and why need to provide --tokenizer_base_model ? Also if using full off-line mode will the --tokenizer_base_model work ?

from h2ogpt.

pseudotensor avatar pseudotensor commented on June 12, 2024

Yes, once off line then do:

TRANSFORMERS_OFFLINE=1 python generate.py --base_model=llama --model_path_llama=Meta-Llama-3-8B-Instruct.Q5_K_M.gguf --tokenizer_base_model=meta-llama/Meta-Llama-3-8B-Instruct --max_seq_len=8192 --gradio_offline_level=2 --share=False --add_disk_models_to_ui=False

which assumes the model was downloaded to location set by llamacpp_path (default is llamacpp_path folder). This works for offline if previously used the earlier command that got the tokenizer.

from h2ogpt.

pseudotensor avatar pseudotensor commented on June 12, 2024

The model prompt template is taken from

https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct/blob/main/tokenizer_config.json#L2053

if using that as the tokenizer_base_model

from h2ogpt.

slavag avatar slavag commented on June 12, 2024

@pseudotensor Thanks a lot !!

from h2ogpt.

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.