Update README.md
Browse files
README.md
CHANGED
@@ -45,7 +45,23 @@ model = PeftModel.from_pretrained(model, "hiyouga/Llama-2-70b-AQLM-2Bit-QLoRA-fu
|
|
45 |
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
46 |
|
47 |
messages = [
|
48 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
]
|
50 |
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
51 |
inputs = inputs.to("cuda")
|
|
|
45 |
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
46 |
|
47 |
messages = [
|
48 |
+
{
|
49 |
+
"role": "system",
|
50 |
+
"content": (
|
51 |
+
"You have access to the following tools:\n"
|
52 |
+
"> Tool Name: get_current_weather\nTool Description: Get the current weather in a given location\n"
|
53 |
+
"Tool Args:\n"
|
54 |
+
" - location (string, required): The city and state, e.g. San Francisco, CA\n"
|
55 |
+
" - unit (string): should be one of [\"celsius\", \"fahrenheit\"]\n\n"
|
56 |
+
"Use the following format if using a tool:\n"
|
57 |
+
"```\n"
|
58 |
+
"Action: tool name (one of [get_current_weather]).\n"
|
59 |
+
"Action Input: the input to the tool, in a JSON format representing the kwargs "
|
60 |
+
"(e.g. ```{\"input\": \"hello world\", \"num_beams\": 5}```).\n"
|
61 |
+
"```\n"
|
62 |
+
)
|
63 |
+
},
|
64 |
+
{"role": "user", "content": "What is the weather like in Boston?"}
|
65 |
]
|
66 |
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
67 |
inputs = inputs.to("cuda")
|