Instructions to use deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16 # Run inference directly in the terminal: llama cli -hf deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16 # Run inference directly in the terminal: llama cli -hf deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16 # Run inference directly in the terminal: ./llama-cli -hf deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16
Use Docker
docker model run hf.co/deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16
- LM Studio
- Jan
- vLLM
How to use deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16
- SGLang
How to use deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16 with Ollama:
ollama run hf.co/deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16
- Unsloth Desktop
- Docker Model Runner
How to use deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16 with Docker Model Runner:
docker model run hf.co/deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16
- Lemonade
How to use deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull deccan-ai/phi-2-insurance_qa-sft-lora-gguf-f16:F16
Run and chat with the model
lemonade run user.phi-2-insurance_qa-sft-lora-gguf-f16-F16
List all available models
lemonade list
- Atomic Chat
Model Summary
This model builds on the architecture of Microsoft's Phi-2, 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-gguf-f16 serves as a text generation model capable of answering questions around insurance.
Dataset
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 deccan-ai/insuranceQA-v2.
Usage
You can use the llama.cpp library to infer from this model. Download the model weights and setup the llama.cpp library.
Input Format
### Instruction: <Question>
### Response:
For instance:
### Instruction: What does Basic Homeowners Insurance Cover?
### Response:
Inference Code
./main -m ggml-model-f16.gguf -p "### Instruction: What does Basic Homeowners Insurance Cover?\n### Response: " --temp 0.1 --top_p 0.95
Training
Model
- Architecture: Phi-2, with LoRA modifications for efficient Insurance domain-specific fine-tuning.
- Context length: 2048 tokens
- Modifications: Added
<|eostoken|>for end-of-response learning - to help the model learn the end of responses, facilitating its use in dialogue systems.
Configuration
- Hyperparameters:
- learning_rate=2e-5,
- batch_size=8,
- epochs=10,
- lora_r=32,
- lora_alpha=64.
- Infrastructure: Trained on an NVIDIA A40 and utilized the
FullyShardedDataParallelPluginfor CPU offloading.
Evaluation
Coming Soon!
Limitations of deccan-ai/phi-2-insurance_qa-sft-lora
- Generate Inaccurate Facts: The model may produce incorrect code snippets and statements. Users should treat these outputs as suggestions or starting points, not as definitive or accurate solutions.
- Unreliable Responses to Instruction: It may struggle or fail to adhere to intricate or nuanced instructions provided by users.
- Language Limitations: The model is primarily designed to understand standard English. Informal English, slang, or any other languages might pose challenges to its comprehension, leading to potential misinterpretations or errors in response.
- Potential Societal Biases: Phi-2 is not entirely free from societal biases despite efforts in assuring training data safety. There's a possibility it may generate content that mirrors these societal biases, particularly if prompted or instructed to do so. We urge users to be aware of this and to exercise caution and critical thinking when interpreting model outputs.
- Toxicity: Despite being trained with carefully selected data, the model can still produce harmful content if explicitly prompted or instructed to do so. We chose to release the model to help the open-source community develop the most effective ways to reduce the toxicity of a model directly after pretraining.
- Verbosity: Phi-2 being a base model often produces irrelevant or extra text and responses following its first answer to user prompts within a single turn. This is due to its training dataset being primarily textbooks, which results in textbook-like responses.
License
The model is licensed under the MIT license.
Citations
[1] Hu, Edward J., et al. "Lora: Low-rank adaptation of large language models." arXiv preprint arXiv:2106.09685 (2021).
[2] 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.
- Downloads last month
- 82
16-bit