Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| finance-chat.Q2_K.gguf | Q2_K | 2.36GB |
| finance-chat.IQ3_XS.gguf | IQ3_XS | 2.6GB |
| finance-chat.IQ3_S.gguf | IQ3_S | 2.75GB |
| finance-chat.Q3_K_S.gguf | Q3_K_S | 2.75GB |
| finance-chat.IQ3_M.gguf | IQ3_M | 2.9GB |
| finance-chat.Q3_K.gguf | Q3_K | 3.07GB |
| finance-chat.Q3_K_M.gguf | Q3_K_M | 3.07GB |
| finance-chat.Q3_K_L.gguf | Q3_K_L | 3.35GB |
| finance-chat.IQ4_XS.gguf | IQ4_XS | 3.4GB |
| finance-chat.Q4_0.gguf | Q4_0 | 3.56GB |
| finance-chat.IQ4_NL.gguf | IQ4_NL | 3.58GB |
| finance-chat.Q4_K_S.gguf | Q4_K_S | 3.59GB |
| finance-chat.Q4_K.gguf | Q4_K | 3.8GB |
| finance-chat.Q4_K_M.gguf | Q4_K_M | 3.8GB |
| finance-chat.Q4_1.gguf | Q4_1 | 3.95GB |
| finance-chat.Q5_0.gguf | Q5_0 | 4.33GB |
| finance-chat.Q5_K_S.gguf | Q5_K_S | 4.33GB |
| finance-chat.Q5_K.gguf | Q5_K | 4.45GB |
| finance-chat.Q5_K_M.gguf | Q5_K_M | 4.45GB |
| finance-chat.Q5_1.gguf | Q5_1 | 4.72GB |
| finance-chat.Q6_K.gguf | Q6_K | 5.15GB |
| finance-chat.Q8_0.gguf | Q8_0 | 6.67GB |

1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("AdaptLLM/finance-chat")
4tokenizer = AutoTokenizer.from_pretrained("AdaptLLM/finance-chat")
5
6# Put your input here:
7user_input = '''Use this fact to answer the question: Title of each class Trading Symbol(s) Name of each exchange on which registered
8Common Stock, Par Value $.01 Per Share MMM New York Stock Exchange
9MMM Chicago Stock Exchange, Inc.
101.500% Notes due 2026 MMM26 New York Stock Exchange
111.750% Notes due 2030 MMM30 New York Stock Exchange
121.500% Notes due 2031 MMM31 New York Stock Exchange
13
14Which debt securities are registered to trade on a national securities exchange under 3M's name as of Q2 of 2023?'''
15
16# Apply the prompt template and system prompt of LLaMA-2-Chat demo for chat models (NOTE: NO prompt template is required for base models!)
17our_system_prompt = "\nYou are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.\n" # Please do NOT change this
18prompt = f"<s>[INST] <<SYS>>{our_system_prompt}<</SYS>>\n\n{user_input} [/INST]"
19
20# # NOTE:
21# # If you want to apply your own system prompt, please integrate it into the instruction part following our system prompt like this:
22# your_system_prompt = "Please, check if the answer can be inferred from the pieces of context provided."
23# prompt = f"<s>[INST] <<SYS>>{our_system_prompt}<</SYS>>\n\n{your_system_prompt}\n{user_input} [/INST]"
24
25inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).input_ids.to(model.device)
26outputs = model.generate(input_ids=inputs, max_length=4096)[0]
27
28answer_start = int(inputs.shape[-1])
29pred = tokenizer.decode(outputs[answer_start:], skip_special_tokens=True)
30
31print(f'### User Input:\n{user_input}\n\n### Assistant Output:\n{pred}')| Metric | Value |
|---|---|
| Avg. | 53.26 |
| AI2 Reasoning Challenge (25-Shot) | 53.75 |
| HellaSwag (10-Shot) | 76.60 |
| MMLU (5-Shot) | 50.16 |
| TruthfulQA (0-shot) | 44.54 |
| Winogrande (5-shot) | 75.69 |
| GSM8k (5-shot) | 18.80 |
1@inproceedings{
2cheng2024adapting,
3title={Adapting Large Language Models via Reading Comprehension},
4author={Daixuan Cheng and Shaohan Huang and Furu Wei},
5booktitle={The Twelfth International Conference on Learning Representations},
6year={2024},
7url={https://openreview.net/forum?id=y886UXPEZ0}
8}