Instructions to use QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF 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 QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M
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 QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M
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 QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M
- Ollama
How to use QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF with Ollama:
ollama run hf.co/QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M
- Unsloth Studio
How to use QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Clinical-BR-LlaMA-2-7B-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF
This is quantized version of pucpr-br/Clinical-BR-LlaMA-2-7B created using llama.cpp
Original Model Card
MED-LLM-BR: Medical Large Language Models for Brazilian Portuguese
MED-LLM-BR is a collaborative project between HAILab and Comsentimento, which aims to develop multiple medical LLMs for Portuguese language, including base models and task-specific models, with different sizes.
Introduction
Clinical-BR-LlaMA-2-7B is a fine-tuned language model specifically designed for generating clinical notes in Portuguese. This model builds on the strengths of LlaMA 2 7B, adapting it through targeted fine-tuning techniques to meet the unique demands of clinical text generation. By focusing on the nuances and complexities of medical language in Portuguese, Clinical-BR-LlaMA-2-7B aims to support healthcare professionals with contextually accurate and relevant clinical documentation.
Fine-Tuning Approach
To enhance memory efficiency and reduce computational demands, we implemented LoRA with 16-bit precision on the q_proj and v_proj projections. We configured LoRA with R set to 8, Alpha to 16, and Dropout to 0.1, allowing the model to adapt effectively while preserving output quality. For optimization, the AdamW optimizer was used with parameters β1 = 0.9 and β2 = 0.999, achieving a balance between fast convergence and training stability. This careful tuning process ensures robust performance in generating accurate and contextually appropriate clinical text in Portuguese.
Data
The fine-tuning of Clinical-BR-LlaMA-2-7B utilized 2.4GB of text from three clinical datasets. The SemClinBr project provided diverse clinical narratives from Brazilian hospitals, while the BRATECA dataset contributed admission notes from various departments in 10 hospitals. Additionally, data from Lopes et al., 2019, added neurology-focused texts from European Portuguese medical journals. These datasets collectively improved the model’s ability to generate accurate clinical notes in Portuguese.
Provisional Citation:
@inproceedings{pinto2024clinicalLLMs,
title = {Developing Resource-Efficient Clinical LLMs for Brazilian Portuguese},
author = {João Gabriel de Souza Pinto and Andrey Rodrigues de Freitas and Anderson Carlos Gomes Martins and Caroline Midori Rozza Sawazaki and Caroline Vidal and Lucas Emanuel Silva e Oliveira},
booktitle = {Proceedings of the 34th Brazilian Conference on Intelligent Systems (BRACIS)},
year = {2024},
note = {In press},
}
- Downloads last month
- 193
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
Model tree for QuantFactory/Clinical-BR-LlaMA-2-7B-GGUF
Base model
meta-llama/Llama-2-7b