Downloads · 30 days
16
1% of all-time downloads
deccan-ai/phi-2-insurance_qa-sft-lora
phi-2-insurance_qa-sft-lora is a text generation model from deccan-ai. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This model builds on the architecture of <a href="https://huggingface.com/microsoft/phi-2"Microsoft's Phi-2</a, incorporating the LoRA [[1]](1) paradigm for supervised fine-tuning on a high quality question answering…
Downloads · 30 days
16
1% of all-time downloads
All-time downloads
1.7K
Public
Parameters
2.8B
5.6 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors5.6 GB · 100%
From the Hugging Face model README
This model builds on the architecture of <a href="https://huggingface.com/microsoft/phi-2">Microsoft's Phi-2</a>, incorporating the LoRA [1] paradigm for supervised fine-tuning on a high quality question answering dataset in the insurance domain.
Thus, deccan-ai/phi-2-insurance_qa-sft-lora serves as a text generation model capable of answering questions around insurance.
We utilise the InsuranceQA dataset [2], which comprises 27.96K QA pairs related to the insurance domain.
The content of this dataset consists of questions from real world users, the answers with high quality were composed by insurance professionals with deep domain knowledge.
Since the dataset isn't available in a readable format on the web, we make it available on huggingface in a jsonl format, at <a href="https://huggingface.com/datasets/deccan-ai/insuranceQA-v2">deccan-ai/insuranceQA-v2</a>.
Phi-2 compatibility has been integrated in the development version (4.37.0.dev) of transformers. Until the official version is released through pip, ensure that you are doing one of the following:
When loading the model, ensure that trust_remote_code=True is passed as an argument of the from_pretrained() function.
Update your local transformers to the development version: 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.
The current transformers version can be verified with: pip list | grep transformers.
### Instruction: <Question>
### Response:
For instance:
### Instruction: What does Basic Homeowners Insurance Cover?
### Response:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
torch.set_default_device("cuda")
model = AutoModelForCausalLM.from_pretrained("deccan-ai/phi-2-insurance_qa-sft-lora", torch_dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("deccan-ai/phi-2-insurance_qa-sft-lora", trust_remote_code=True)
inputs = tokenizer('''### Instruction: What Does Basic Homeowners Insurance Cover?\n### Response: ''', return_tensors="pt", return_attention_mask=False)
outputs = model.generate(**inputs, max_length=1024)
text = tokenizer.batch_decode(outputs)[0]
print(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.Coming Soon!
deccan-ai/phi-2-insurance_qa-sft-loraThe model is licensed under the MIT license.
[1] <a id="1" href="https://arxiv.org/abs/2106.09685">Hu, Edward J., et al. "Lora: Low-rank adaptation of large language models." arXiv preprint arXiv:2106.09685 (2021).</a></br> [2] <a id="2" href="https://ieeexplore.ieee.org/abstract/document/7404872/">Feng, Minwei, et al. "Applying deep learning to answer selection: A study and an open task." 2015 IEEE workshop on automatic speech recognition and understanding (ASRU). IEEE, 2015.</a>