Views
No views yet
soulhq-ai/phi-2-insurance_qa-sft-lora serves as a text generation model capable of answering questions around insurance.jsonl format, at soulhq-ai/insuranceQA-v2.transformers. Until the official version is released through pip, ensure that you are doing one of the following:trust_remote_code=True is passed as an argument of the from_pretrained() function.pip uninstall -y transformers && pip install git+https://github.com/huggingface/transformers. The previous command is an alternative to cloning and installing from the source.pip list | grep transformers.### Instruction: <Question>
### Response: ### Instruction: What does Basic Homeowners Insurance Cover?
### Response: 1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4torch.set_default_device("cuda")
5
6model = AutoModelForCausalLM.from_pretrained("soulhq-ai/phi-2-insurance_qa-sft-lora", torch_dtype="auto", trust_remote_code=True)
7tokenizer = AutoTokenizer.from_pretrained("soulhq-ai/phi-2-insurance_qa-sft-lora", trust_remote_code=True)
8
9inputs = tokenizer('''### Instruction: What Does Basic Homeowners Insurance Cover?\n### Response: ''', return_tensors="pt", return_attention_mask=False)
10
11outputs = model.generate(**inputs, max_length=1024)
12text = tokenizer.batch_decode(outputs)[0]
13print(text)<|eostoken|> for end-of-response learning - to help the model learn the end of responses, facilitating its use in dialogue systems.FullyShardedDataParallelPlugin for CPU offloading.soulhq-ai/phi-2-insurance_qa-sft-lora