Apollo-1
Collection
Multilingual Medicine: English, Chinese, French, Hindi, Spanish, Hindi, Arabic • 7 items • Updated • 1
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("FreedomIntelligence/Apollo-0.5B")
model = AutoModelForCausalLM.from_pretrained("FreedomIntelligence/Apollo-0.5B")
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=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))Covering English, Chinese, French, Hindi, Spanish, Hindi, Arabic So far
👨🏻💻Github •📃 Paper • 🌐 Demo • 🤗 ApolloCorpus • 🤗 XMedBench
中文 | English
🤗 Apollo-0.5B • 🤗 Apollo-1.8B • 🤗 Apollo-2B • 🤗 Apollo-6B • 🤗 Apollo-7B • 🤗 Apollo-34B • 🤗 Apollo-72B
🤗 MedJamba
🤗 Apollo-0.5B-GGUF • 🤗 Apollo-2B-GGUF • 🤗 Apollo-6B-GGUF • 🤗 Apollo-7B-GGUF
User:{query}\nAssistant:{response}<|endoftext|>
Dataset 🤗 ApolloCorpus
[
"string1",
"string2",
...
]
[
[
"q1",
"a1",
"q2",
"a2",
...
],
...
]
[
[
"q1",
"a1",
"q2",
"a2",
...
],
...
]
Evaluation 🤗 XMedBench
EN:
ZH:
ES: Head_qa
FR: Frenchmedmcqa
HI: MMLU_HI
AR: MMLU_Ara
Waiting for Update
Please use the following citation if you intend to use our dataset for training or evaluation:
@misc{wang2024apollo,
title={Apollo: Lightweight Multilingual Medical LLMs towards Democratizing Medical AI to 6B People},
author={Xidong Wang and Nuo Chen and Junyin Chen and Yan Hu and Yidong Wang and Xiangbo Wu and Anningzhe Gao and Xiang Wan and Haizhou Li and Benyou Wang},
year={2024},
eprint={2403.03640},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FreedomIntelligence/Apollo-0.5B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)