Downloads · 30 days
13
4% of all-time downloads
hiyouga/Llama-2-70b-AQLM-2Bit-QLoRA-function-calling
Llama-2-70b-AQLM-2Bit-QLoRA-function-calling is a text generation model from hiyouga. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama2.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
13
4% of all-time downloads
All-time downloads
315
Public
Repo size
66.1 MB
Likes
8
Public
Click a slice to open those files.
.safetensors65.6 MB · 99%
From the Hugging Face model README
This model is fine-tuned from BlackSamorez/Llama-2-70b-AQLM-2Bit-1x16-hf using LLaMA Factory.
The maximum GPU usage during training is 24GB, and the model has preliminary conversation and tool-using abilities.
It requires at least 20GB GRAM at inference.

This model is fine-tuned using 2,000 examples of the Alpaca-GPT4 and Glaive-function-calling-v2 datasets.
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("hiyouga/Llama-2-70b-AQLM-2Bit-QLoRA-function-calling")
model = AutoModelForCausalLM.from_pretrained("BlackSamorez/Llama-2-70b-AQLM-2Bit-1x16-hf", torch_dtype="auto", device_map="auto")
model = PeftModel.from_pretrained(model, "hiyouga/Llama-2-70b-AQLM-2Bit-QLoRA-function-calling")
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
messages = [
{
"role": "system",
"content": (
"You have access to the following tools:\n"
"> Tool Name: get_current_weather\nTool Description: Get the current weather in a given location\n"
"Tool Args:\n"
" - location (string, required): The city and state, e.g. San Francisco, CA\n"
" - unit (string): should be one of [\"celsius\", \"fahrenheit\"]\n\n"
"Use the following format if using a tool:\n"
"```\n"
"Action: tool name (one of [get_current_weather]).\n"
"Action Input: the input to the tool, in a JSON format representing the kwargs "
"(e.g. ```{\"input\": \"hello world\", \"num_beams\": 5}```).\n"
"```\n"
)
},
{"role": "user", "content": "What is the weather like in Boston?"}
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
inputs = inputs.to("cuda")
generate_ids = model.generate(inputs, streamer=streamer)
The following hyperparameters were used during training:

| MMLU Benchmark | Bits | Metric | Accurary |
|---|---|---|---|
| Average | 2 | 5-shot, top-1 | 62.38 |
| STEM | 2 | 5-shot, top-1 | 51.57 |
| Social Sciences | 2 | 5-shot, top-1 | 73.44 |
| Humanities | 2 | 5-shot, top-1 | 57.82 |
| Other | 2 | 5-shot, top-1 | 68.56 |