andrijdavid commited on
Commit
69abda6
β€’
1 Parent(s): 063fb0c

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +14 -7
  2. tokenizer.json +0 -0
README.md CHANGED
@@ -217,9 +217,10 @@ We explore **continued pre-training on domain-specific corpora** for large langu
217
  ### πŸ€— We are currently working hard on developing models across different domains, scales and architectures! Please stay tuned! πŸ€—
218
 
219
  **************************** **Updates** ****************************
220
- * 12/19: Released our [13B base models](https://huggingface.co/AdaptLLM/finance-LLM-13B) developed from LLaMA-1-13B.
221
- * 12/8: Released our [chat models](https://huggingface.co/AdaptLLM/finance-chat) developed from LLaMA-2-Chat-7B.
222
- * 9/18: Released our [paper](https://huggingface.co/papers/2309.09530), [code](https://github.com/microsoft/LMOps), [data](https://huggingface.co/datasets/AdaptLLM/finance-tasks), and [base models](https://huggingface.co/AdaptLLM/finance-LLM) developed from LLaMA-1-7B.
 
223
 
224
  ## Domain-Specific LLaMA-1
225
  ### LLaMA-1-7B
@@ -235,12 +236,12 @@ Moreover, we scale up our base model to LLaMA-1-13B to see if **our method is si
235
  ## Domain-Specific LLaMA-2-Chat
236
  Our method is also effective for aligned models! LLaMA-2-Chat requires a [specific data format](https://huggingface.co/blog/llama2#how-to-prompt-llama-2), and our **reading comprehension can perfectly fit the data format** by transforming the reading comprehension into a multi-turn conversation. We have also open-sourced chat models in different domains: [Biomedicine-Chat](https://huggingface.co/AdaptLLM/medicine-chat), [Finance-Chat](https://huggingface.co/AdaptLLM/finance-chat) and [Law-Chat](https://huggingface.co/AdaptLLM/law-chat)
237
 
238
- For example, to chat with the finance model:
239
  ```python
240
  from transformers import AutoModelForCausalLM, AutoTokenizer
241
 
242
  model = AutoModelForCausalLM.from_pretrained("AdaptLLM/finance-chat")
243
- tokenizer = AutoTokenizer.from_pretrained("AdaptLLM/finance-chat", use_fast=False)
244
 
245
  # Put your input here:
246
  user_input = '''Use this fact to answer the question: Title of each class Trading Symbol(s) Name of each exchange on which registered
@@ -252,8 +253,14 @@ MMM Chicago Stock Exchange, Inc.
252
 
253
  Which debt securities are registered to trade on a national securities exchange under 3M's name as of Q2 of 2023?'''
254
 
255
- # We use the prompt template of LLaMA-2-Chat demo
256
- prompt = f"<s>[INST] <<SYS>>\nYou are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.\n<</SYS>>\n\n{user_input} [/INST]"
 
 
 
 
 
 
257
 
258
  inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).input_ids.to(model.device)
259
  outputs = model.generate(input_ids=inputs, max_length=4096)[0]
 
217
  ### πŸ€— We are currently working hard on developing models across different domains, scales and architectures! Please stay tuned! πŸ€—
218
 
219
  **************************** **Updates** ****************************
220
+ * 2024/1/16: πŸŽ‰ Our [research paper](https://huggingface.co/papers/2309.09530) has been accepted by ICLR 2024!!!πŸŽ‰
221
+ * 2023/12/19: Released our [13B base models](https://huggingface.co/AdaptLLM/law-LLM-13B) developed from LLaMA-1-13B.
222
+ * 2023/12/8: Released our [chat models](https://huggingface.co/AdaptLLM/law-chat) developed from LLaMA-2-Chat-7B.
223
+ * 2023/9/18: Released our [paper](https://huggingface.co/papers/2309.09530), [code](https://github.com/microsoft/LMOps), [data](https://huggingface.co/datasets/AdaptLLM/law-tasks), and [base models](https://huggingface.co/AdaptLLM/law-LLM) developed from LLaMA-1-7B.
224
 
225
  ## Domain-Specific LLaMA-1
226
  ### LLaMA-1-7B
 
236
  ## Domain-Specific LLaMA-2-Chat
237
  Our method is also effective for aligned models! LLaMA-2-Chat requires a [specific data format](https://huggingface.co/blog/llama2#how-to-prompt-llama-2), and our **reading comprehension can perfectly fit the data format** by transforming the reading comprehension into a multi-turn conversation. We have also open-sourced chat models in different domains: [Biomedicine-Chat](https://huggingface.co/AdaptLLM/medicine-chat), [Finance-Chat](https://huggingface.co/AdaptLLM/finance-chat) and [Law-Chat](https://huggingface.co/AdaptLLM/law-chat)
238
 
239
+ For example, to chat with the finance-chat model:
240
  ```python
241
  from transformers import AutoModelForCausalLM, AutoTokenizer
242
 
243
  model = AutoModelForCausalLM.from_pretrained("AdaptLLM/finance-chat")
244
+ tokenizer = AutoTokenizer.from_pretrained("AdaptLLM/finance-chat")
245
 
246
  # Put your input here:
247
  user_input = '''Use this fact to answer the question: Title of each class Trading Symbol(s) Name of each exchange on which registered
 
253
 
254
  Which debt securities are registered to trade on a national securities exchange under 3M's name as of Q2 of 2023?'''
255
 
256
+ # Apply the prompt template and system prompt of LLaMA-2-Chat demo for chat models (NOTE: NO prompt template is required for base models!)
257
+ our_system_prompt = "\nYou are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.\n" # Please do NOT change this
258
+ prompt = f"<s>[INST] <<SYS>>{our_system_prompt}<</SYS>>\n\n{user_input} [/INST]"
259
+
260
+ # # NOTE:
261
+ # # If you want to apply your own system prompt, please integrate it into the instruction part following our system prompt like this:
262
+ # your_system_prompt = "Please, check if the answer can be inferred from the pieces of context provided."
263
+ # prompt = f"<s>[INST] <<SYS>>{our_system_prompt}<</SYS>>\n\n{your_system_prompt}\n{user_input} [/INST]"
264
 
265
  inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).input_ids.to(model.device)
266
  outputs = model.generate(input_ids=inputs, max_length=4096)[0]
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff