Text Generation
Transformers
Safetensors
English
llama
finance
text-generation-inference
Inference Endpoints
instruction-pretrain commited on
Commit
cde5d71
1 Parent(s): 14ebbbf

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -1
README.md CHANGED
@@ -29,12 +29,14 @@ We explore supervised multitask pre-training by proposing ***Instruction Pre-Tra
29
  - Domain-Specific Models Pre-Trained from Llama3-8B:
30
  - [Finance-Llama3-8B](https://huggingface.co/instruction-pretrain/finance-Llama3-8B)
31
  - [Biomedicine-Llama3-8B](https://huggingface.co/instruction-pretrain/medicine-Llama3-8B)
 
 
32
 
33
 
34
  ## Domain-Adaptive Continued Pre-Training
35
  Following [AdaptLLM](https://huggingface.co/AdaptLLM/finance-chat), we augment the domain-specific raw corpora with instruction-response pairs generated by our [context-based instruction synthesizer](https://huggingface.co/instruction-pretrain/instruction-synthesizer).
36
 
37
- For example, to chat with the finance-Llama3-8B model:
38
  ```python
39
  from transformers import AutoModelForCausalLM, AutoTokenizer
40
 
@@ -60,6 +62,31 @@ pred = tokenizer.decode(outputs[answer_start:], skip_special_tokens=True)
60
  print(pred)
61
  ```
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  ## Citation
64
  If you find our work helpful, please cite us:
65
 
 
29
  - Domain-Specific Models Pre-Trained from Llama3-8B:
30
  - [Finance-Llama3-8B](https://huggingface.co/instruction-pretrain/finance-Llama3-8B)
31
  - [Biomedicine-Llama3-8B](https://huggingface.co/instruction-pretrain/medicine-Llama3-8B)
32
+ - General Instruction-Augmented Corpora: [general-instruction-augmented-corpora](https://huggingface.co/datasets/instruction-pretrain/general-instruction-augmented-corpora)
33
+ - Domain-Specific Instruction-Augmented Corpora (no finance data to avoid ethical issues): [medicine-instruction-augmented-corpora](https://huggingface.co/datasets/instruction-pretrain/medicine-instruction-augmented-corpora)
34
 
35
 
36
  ## Domain-Adaptive Continued Pre-Training
37
  Following [AdaptLLM](https://huggingface.co/AdaptLLM/finance-chat), we augment the domain-specific raw corpora with instruction-response pairs generated by our [context-based instruction synthesizer](https://huggingface.co/instruction-pretrain/instruction-synthesizer).
38
 
39
+ ### 1. To chat with the finance-Llama3-8B model:
40
  ```python
41
  from transformers import AutoModelForCausalLM, AutoTokenizer
42
 
 
62
  print(pred)
63
  ```
64
 
65
+ ### 2. To evaluate our models on the domain-specific tasks
66
+ 1. Set up dependencies
67
+ ```bash
68
+ git clone https://github.com/microsoft/LMOps
69
+ cd LMOps/adaptllm
70
+ pip install -r requirements.txt
71
+ ```
72
+
73
+ 2. Evaluate
74
+ ```bash
75
+ DOMAIN='finance'
76
+
77
+ # if the model can fit on a single GPU: set MODEL_PARALLEL=False
78
+ # elif the model is too large to fit on a single GPU: set MODEL_PARALLEL=True
79
+ MODEL_PARALLEL=False
80
+
81
+ # number of GPUs, chosen from [1,2,4,8]
82
+ N_GPU=1
83
+
84
+ # Set as True
85
+ add_bos_token=True
86
+
87
+ bash scripts/inference.sh ${DOMAIN} 'instruction-pretrain/finance-Llama3-8B' ${add_bos_token} ${MODEL_PARALLEL} ${N_GPU}
88
+ ```
89
+
90
  ## Citation
91
  If you find our work helpful, please cite us:
92