Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| janus-dpo-7b.Q2_K.gguf | Q2_K | 2.53GB |
| janus-dpo-7b.IQ3_XS.gguf | IQ3_XS | 2.81GB |
| janus-dpo-7b.IQ3_S.gguf | IQ3_S | 2.96GB |
| janus-dpo-7b.Q3_K_S.gguf | Q3_K_S | 1.56GB |
| janus-dpo-7b.IQ3_M.gguf | IQ3_M | 3.06GB |
| janus-dpo-7b.Q3_K.gguf | Q3_K | 3.28GB |
| janus-dpo-7b.Q3_K_M.gguf | Q3_K_M | 3.28GB |
| janus-dpo-7b.Q3_K_L.gguf | Q3_K_L | 3.56GB |
| janus-dpo-7b.IQ4_XS.gguf | IQ4_XS | 3.67GB |
| janus-dpo-7b.Q4_0.gguf | Q4_0 | 3.83GB |
| janus-dpo-7b.IQ4_NL.gguf | IQ4_NL | 3.87GB |
| janus-dpo-7b.Q4_K_S.gguf | Q4_K_S | 3.86GB |
| janus-dpo-7b.Q4_K.gguf | Q4_K | 4.07GB |
| janus-dpo-7b.Q4_K_M.gguf | Q4_K_M | 4.07GB |
| janus-dpo-7b.Q4_1.gguf | Q4_1 | 4.24GB |
| janus-dpo-7b.Q5_0.gguf | Q5_0 | 4.65GB |
| janus-dpo-7b.Q5_K_S.gguf | Q5_K_S | 4.65GB |
| janus-dpo-7b.Q5_K.gguf | Q5_K | 4.78GB |
| janus-dpo-7b.Q5_K_M.gguf | Q5_K_M | 4.78GB |
| janus-dpo-7b.Q5_1.gguf | Q5_1 | 5.07GB |
| janus-dpo-7b.Q6_K.gguf | Q6_K | 5.53GB |
| janus-dpo-7b.Q8_0.gguf | Q8_0 | 7.17GB |

[INST]{system_message}\n{instruction}[/INST]1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_name = "kaist-ai/janus-dpo-7b"
5device = "cuda:0"
6
7# Load the model and tokenizer
8tokenizer = AutoTokenizer.from_pretrained(model_name)
9
10dtype = "float16"
11if torch.cuda.is_bf16_supported():
12 dtype = "bfloat16"
13
14model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=getattr(torch, dtype))
15model.eval()
16model.to(device)
17
18# Prepare inputs
19system = "As a financial news headline writer with a flair for the dramatic, you have taken on the role of crafting compelling headlines about the integration of AI into the financial sector. Your expertise allows you to weave industry-specific terminology seamlessly into each headline, striking a balance between capturing attention and providing meaningful insights into the transformative benefits of AI in finance. With each headline, you focus on elucidating the key advantages AI brings to financial operations, making complex information accessible and immediately impactful. While your headlines are designed to engage and inform an audience of finance and technology professionals, you navigate the fine line of excitement and accuracy with care, ensuring that the promises made are grounded in reality, thus avoiding any form of sensationalism. Your mission is to distill the essence of AI's impact on finance into a single, powerful line that speaks volumes to the informed reader."
20prompt = "Write a headline for an article about the benefits of using AI in the finance sector."
21
22def apply_template_mistral_instruct(system_message, content):
23 prompt = f"{system_message}\n{content}".strip()
24 return f"[INST] {prompt} [/INST] "
25
26input_str = apply_template_mistral_instruct(system, prompt)
27input_ids = tokenizer.encode(input_str, return_tensors="pt")
28print(input_str)
29
30model_inputs = input_ids.to(device)
31
32# Generate text
33output_ids = model.generate(model_inputs, max_new_tokens=1024)
34decoded = tokenizer.batch_decode(output_ids, skip_special_tokens=True)
35print(decoded[0][len(input_str):])
36# Revolutionary Trends: How AI Is Redefining Efficiency and Accuracy in the Financial Realm1@article{lee2024aligning,
2 title={Aligning to Thousands of Preferences via System Message Generalization},
3 author={Lee, Seongyun and Park, Sue Hyun and Kim, Seungone and Seo, Minjoon},
4 journal={arXiv preprint arXiv:2405.17977},
5 year={2024}
6}