Instructions to use lighteternal/Llama3-merge-biomed-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lighteternal/Llama3-merge-biomed-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lighteternal/Llama3-merge-biomed-8b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lighteternal/Llama3-merge-biomed-8b") model = AutoModelForCausalLM.from_pretrained("lighteternal/Llama3-merge-biomed-8b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lighteternal/Llama3-merge-biomed-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lighteternal/Llama3-merge-biomed-8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lighteternal/Llama3-merge-biomed-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lighteternal/Llama3-merge-biomed-8b
- SGLang
How to use lighteternal/Llama3-merge-biomed-8b 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 "lighteternal/Llama3-merge-biomed-8b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lighteternal/Llama3-merge-biomed-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "lighteternal/Llama3-merge-biomed-8b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lighteternal/Llama3-merge-biomed-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lighteternal/Llama3-merge-biomed-8b with Docker Model Runner:
docker model run hf.co/lighteternal/Llama3-merge-biomed-8b
Llama3-merge-biomed-8b
This is a DARE-TIES Merge of Llama3-8b-Instruct + NousResearch/Hermes-2-Pro-Llama-3-8B + aaditya/Llama3-OpenBioLLM-8B. It is a simple experiment to assess whether combining models with strengths in general language understanding and biomedical knowledge can enhance performance on specialized tasks without compromising general applicability. The results indicate promising outcomes in areas like HendrycksTest tasks related to Biology and Medicine, as well as improvements in complex reasoning as seen in the ARC Challenge and Winogrande benchmarks.
Usage
I recommend using the prompt template of Llama3: https://llama.meta.com/docs/model-cards-and-prompt-formats/meta-llama-3/
Leaderboard metrics according to 🤗 Open LLM Leaderboard
| Task | Metric | Ours (%) | Llama38BInstr. (%) | OpenBioLLM8B (%) |
|---|---|---|---|---|
| ARC Challenge | Accuracy | 59.39 | 57.17 | 55.38 |
| Normalized Accuracy | 63.65 | 60.75 | 58.62 | |
| Hellaswag | Accuracy | 62.59 | 59.04 | 61.83 |
| Normalized Accuracy | 81.53 | 78.55 | 80.76 | |
| Winogrande | Accuracy | 75.93 | 74.51 | 70.88 |
| GSM8K | Accuracy | 59.36 | 68.69 | 10.15 |
| HendrycksTest-Anatomy | Accuracy | 72.59 | 65.19 | 69.62 |
| HendrycksTest-Clinical Knowledge | Accuracy | 77.83 | 74.72 | 60.38 |
| HendrycksTest-College Biology | Accuracy | 81.94 | 79.86 | 79.86 |
| HendrycksTest-College Medicine | Accuracy | 69.36 | 63.58 | 70.52 |
| HendrycksTest-Medical Genetics | Accuracy | 86.00 | 80.00 | 80.00 |
| HendrycksTest-Professional Medicine | Accuracy | 77.94 | 71.69 | 77.94 |
This is a merge of pre-trained language models created using mergekit.
Merge Details
Merge Method
This model was merged using the DARE TIES merge method using meta-llama/Meta-Llama-3-8B-Instruct as a base.
Models Merged
The following models were included in the merge:
Configuration
The following YAML configuration was used to produce this model:
models:
- model: meta-llama/Meta-Llama-3-8B-Instruct
# Base model providing a general foundation without specific parameters
- model: meta-llama/Meta-Llama-3-8B-Instruct
parameters:
density: 0.60
weight: 0.5
- model: NousResearch/Hermes-2-Pro-Llama-3-8B
parameters:
density: 0.55
weight: 0.1
- model: aaditya/Llama3-OpenBioLLM-8B
parameters:
density: 0.55
weight: 0.4
merge_method: dare_ties
base_model: meta-llama/Meta-Llama-3-8B-Instruct
parameters:
int8_mask: true
dtype: bfloat16
- Downloads last month
- 39