Instructions to use nlpie/Llama2-MedTuned-13b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nlpie/Llama2-MedTuned-13b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nlpie/Llama2-MedTuned-13b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nlpie/Llama2-MedTuned-13b") model = AutoModelForCausalLM.from_pretrained("nlpie/Llama2-MedTuned-13b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nlpie/Llama2-MedTuned-13b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nlpie/Llama2-MedTuned-13b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nlpie/Llama2-MedTuned-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nlpie/Llama2-MedTuned-13b
- SGLang
How to use nlpie/Llama2-MedTuned-13b 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 "nlpie/Llama2-MedTuned-13b" \ --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": "nlpie/Llama2-MedTuned-13b", "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 "nlpie/Llama2-MedTuned-13b" \ --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": "nlpie/Llama2-MedTuned-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nlpie/Llama2-MedTuned-13b with Docker Model Runner:
docker model run hf.co/nlpie/Llama2-MedTuned-13b
Model Description
Llama2-MedTuned-13b represents an advanced version of the Llama2 13B model, fine-tuned for complex biomedical language processing. This model has been tailored through instruction tuning on a dataset comprising around 200,000 samples, specifically targeting biomedical NLP tasks such as Named Entity Recognition (NER), Relation Extraction (RE), and Medical Natural Language Inference (NLI).
Instruction Tuning Procedure
This model is fine-tuned using a unique instruction-based approach, aimed at enhancing its performance on specific biomedical tasks. The process involved the employment of a meticulously curated dataset, designed to effectively align with the challenging requirements of biomedical and clinical NLP tasks.
Model Capabilities
Llama2-MedTuned-13b is adept at understanding intricate biomedical contexts and is particularly effective in executing NER, RE, and NLI tasks with higher accuracy. It is proficient in generating outputs that align well with the structured formats required for standard evaluation metrics in biomedical NLP.
Architecture
The Llama2-MedTuned-13b model is built upon the autoregressive transformer architecture of the original Llama2 13B model. This model preserves the core transformer layers and attention mechanisms, with specialised adjustments for enhanced performance in the biomedical language domain.
Citation
For using Llama2-MedTuned-13b in academic work or applications, kindly cite the following paper:
@article{rohanian2024exploring,
title = {Exploring the Effectiveness of Instruction Tuning in Biomedical Language Processing},
author = {Rohanian, Omid and Nouriborji, Mohammadmahdi and Kouchaki, Samaneh and Nooralahzadeh, Farhad and Clifton, Lei and Clifton, David A},
journal = {Artificial Intelligence in Medicine},
volume = {158},
pages = {103007},
year = {2024},
publisher = {Elsevier},
doi = {10.1016/j.artmed.2024.103007},
url = {https://www.sciencedirect.com/science/article/pii/S0933365724002495},
issn = {0933-3657}
}
Support
If this model helps your work, you can keep the project running with a one-off or monthly contribution:
https://github.com/sponsors/nlpie-research
- Downloads last month
- 688