Views
No views yet

transformers>=4.45.0, to avoid any potential errors when using this model.\n\n or <doc-sep> to maintain consistency with the format of the data used during training.1model = AutoModelForCausalLM.from_pretrained("yale-nlp/MDCure-LLAMA3.1-8B-Instruct", device_map='auto',torch_dtype="auto")
2tokenizer = AutoTokenizer.from_pretrained("yale-nlp/MDCure-LLAMA3.1-8B-Instruct")
3
4source_text_1 = ...
5source_text_2 = ...
6source_text_3 = ...
7prompt = f"{source_text_1}\n\n{source_text_2}\n\n{source_text_3}\n\nWhat happened in CHAMPAIGN regarding Lovie Smith and the 2019 defense improvements? Respond with 1-2 sentences."
8
9messages = [
10 {"role": "system", "content": "You are an assistant with strong multi-document processing skills."},
11 {"role": "user", "content": prompt},
12 ]
13
14text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
15model_inputs = tokenizer([text], return_tensors="pt", return_token_type_ids=False).to(model.device)
16
17generated_ids = model.generate(**model_inputs, max_new_tokens=512)
18generated_ids = [output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)]
19
20response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
21print(response)pipeline abstraction, described further in the official LLAMA3.1-8B-Instruct model card.| Model | Huggingface Repo | Description |
|---|---|---|
| MDCureRM | 🤗 HF Repo | Multi-objective reward model to score and filter MD instruction data more cheaply and effectively than GPT-3.5-Turbo |
| MDCure-FlanT5-Base | 🤗 HF Repo | FlanT5-Base fine-tuned with MDCure-72k |
| MDCure-FlanT5-Large | 🤗 HF Repo | FlanT5-Large fine-tuned with MDCure-72k |
| MDCure-Qwen2-1.5B-Instruct | 🤗 HF Repo | Qwen2-1.5B-Instruct fine-tuned with MDCure-72k |
| MDCure-Qwen2-7B-Instruct | 🤗 HF Repo | Qwen2-7B-Instruct fine-tuned with MDCure-72k |
| MDCure-LLAMA3.1-8B-Instruct | 🤗 HF Repo | LLAMA3.1-8B-Instruct fine-tuned with MDCure-72k |
| MDCure-LLAMA3.1-70B-Instruct | 🤗 HF Repo | LLAMA3.1-70B-Instruct fine-tuned with MDCure-72 |
1@article{liu2024mdcure,
2 title={MDCure: A Scalable Pipeline for Multi-Document Instruction-Following},
3 author={Gabrielle Kaili-May Liu and Bowen Shi and Avi Caciularu and Idan Szpektor and Arman Cohan},
4 journal={arXiv preprint arXiv:2410.23463},
5 year={2024},
6 url={https://arxiv.org/abs/2410.23463}
7}