Explain what this github page is documeintg like i am a layperson: ""## Advanced Usage…
- User
Explain what this github page is documeintg like i am a layperson: ""## Advanced Usage
One-click scripts
Argument description of run.py (supported MatMul combinations):
Argument Description model Directory containing model file or model id: String --weight_dtype Data type of quantized weight: int4/int8/fp8(=fp8_e4m3)/fp8_e5m2/fp4(=fp4e2m1)/nf4 (default int4) --alg Quantization algorithm: sym/asym (default sym) --group_size Group size: Int, 32/128/-1 (per channel) (default: 32) --scale_dtype Data type of scales: fp32/bf16/fp8 (default fp32) --compute_dtype Data type of Gemm computation: int8/bf16/fp16/fp32 (default: fp32) --use_ggml Enable ggml for quantization and inference -p / --prompt Prompt to start generation with: String (default: empty) -f / --file Path to a text file containing the prompt (for large prompts) -n / --n_predict Number of tokens to predict: Int (default: -1, -1 = infinity) -t / --threads Number of threads to use during computation: Int (default: 56) -b / --batch_size_truncate Batch size for prompt processing: Int (default: 512) -c / --ctx_size Size of the prompt context: Int (default: 512, can not be larger than specific model's context window length) -s / --seed NG seed: Int (default: -1, use random seed for < 0) --repeat_penalty Penalize repeat sequence of tokens: Float (default: 1.1, 1.0 = disabled) --color Colorise output to distinguish prompt and user input from generations --keep Number of tokens to keep from the initial prompt: Int (default: 0, -1 = all) --shift-roped-k Use ring-buffer and thus do not re-computing after reaching ctx_size (default: False) --token Access token ID for models that require it (e.g: LLaMa2, etc..) - Assistant
This GitHub page is documenting a project that focuses on the advanced usage of machine learning (ML) models, specifically in areas like model conversion, quantization, and inference using scripts. Let me break down the key points in simpler terms:
- User
Am i loading in a model that has already been quantized into a gguf format?
- Assistant
Based on the information provided in the GitHub documentation excerpt you shared, it appears that the process involves converting and quantizing a model into a format that is compatible with the project's requirements, specifically, for efficient inference. The mention of "ggml" suggests the use of a specific library or format for handling quantized models. However, "gguf" is not explicitly mentioned in the excerpt you provided.
- User
i just want to load a model that has already been quantized. should i follow this instad? :""GGUF Model from Hugging Face from transformers import AutoTokenizer, TextStreamer from intel_extension_for_transformers.transformers import AutoModelForCausalLM
Specify the GGUF repo on the Hugginface
model_name = "TheBloke/Llama-2-7B-Chat-GGUF"
Download the the specific gguf model file from the above repo
model_file = "llama-2-7b-chat.Q4_0.gguf"
make sure you are granted to access this model on the Huggingface.
tokenizer_name = "meta-llama/Llama-2-7b-chat-hf"
prompt = "Once upon a time" tokenizer = AutoTokenizer.from_pretrained(tokenizer_name, trust_remote_code=True) inputs = tokenizer(prompt, return_tensors="pt").input_ids streamer = TextStreamer(tokenizer) model = AutoModelForCausalLM.from_pretrained(model_name, model_file = model_file) outputs = model.generate(inputs, streamer=streamer, max_new_tokens=300)""
- Assistant
Yes, if your goal is to load and use a model that has already been quantized and is hosted on Hugging Face under the GGUF format, then following the provided instructions would be the correct approach. Here’s a breakdown of the steps to make it clear: