
# PMCtuned-13b

PMCtuned-13b is a merge of the following models:
* [nlpie/Llama2-MedTuned-13b](https://huggingface.co/nlpie/Llama2-MedTuned-13b)
* [axiong/PMC_LLaMA_13B](https://huggingface.co/axiong/PMC_LLaMA_13B)

## Evaluations

| Benchmark | PMCtuned-13b | Orca-2-7b | llama-2-7b | meditron-7b | meditron-70b |
| --- | --- | --- | --- | --- | --- |
| MedMCQA |  |  |  |  |  |
| ClosedPubMedQA |  |  |  |  |  |
| PubMedQA |  |  |  |  |  |
| MedQA |  |  |  |  |  |
| MedQA4 |  |  |  |  |  |
| MedicationQA |  |  |  |  |  |
| MMLU Medical |  |  |  |  |  |
| MMLU |  |  |  |  |  |
| TruthfulQA |  |  |  |  |  |
| GSM8K |  |  |  |  |  |
| ARC |  |  |  |  |  |
| HellaSwag |  |  |  |  |  |
| Winogrande |  |  |  |  |  |

More details on the Open LLM Leaderboard evaluation results can be found here.

## 🧩 Configuration

```yaml
slices:
  - sources:
      - model: nlpie/Llama2-MedTuned-13b
        layer_range: [0, 32]
      - model: axiong/PMC_LLaMA_13B
        layer_range: [0, 32]
merge_method: slerp
base_model: axiong/PMC_LLaMA_13B
parameters:
  t:
    - filter: self_attn
      value: [0, 0.5, 0.3, 0.7, 1]
    - filter: mlp
      value: [1, 0.5, 0.7, 0.3, 0]
    - value: 0.5
dtype: bfloat16
```

## 💻 Usage

```python
!pip install -qU transformers accelerate

from transformers import AutoTokenizer
import transformers
import torch

model = "Technoculture/PMCtuned-13b"
messages = [{"role": "user", "content": "I am feeling sleepy these days"}]

tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])
```
{"license": "apache-2.0", "tags": ["merge", "mergekit", "nlpie/Llama2-MedTuned-13b", "axiong/PMC_LLaMA_13B"]}
transformers safetensors llama text-generation merge mergekit nlpie/Llama2-MedTuned-13b axiong/PMC_LLaMA_13B license:apache-2.0 autotrain_compatible endpoints_compatible text-generation-inference region:us