[LLM] Small fix to MPT Example (#8513)
This commit is contained in:
		
							parent
							
								
									ba0da17b40
								
							
						
					
					
						commit
						bcde8ec83e
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -16,7 +16,7 @@ conda create -n llm python=3.9
 | 
				
			||||||
conda activate llm
 | 
					conda activate llm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pip install bigdl-llm[all] # install bigdl-llm with 'all' option
 | 
					pip install bigdl-llm[all] # install bigdl-llm with 'all' option
 | 
				
			||||||
pip instll einops  # additional package required for mpt-7b-chat to conduct generation
 | 
					pip install einops  # additional package required for mpt-7b-chat to conduct generation
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### 2. Config
 | 
					### 2. Config
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,14 +22,14 @@ from bigdl.llm.transformers import AutoModelForCausalLM
 | 
				
			||||||
from transformers import AutoTokenizer
 | 
					from transformers import AutoTokenizer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# you could revise it based on the MPT model you choose to use
 | 
					# you could revise it based on the MPT model you choose to use
 | 
				
			||||||
MPT_PROMPT_FORMAT="<human>{prompt} <bot>"
 | 
					MPT_PROMPT_FORMAT = "<human>{prompt} <bot>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == '__main__':
 | 
					if __name__ == '__main__':
 | 
				
			||||||
    parser = argparse.ArgumentParser(description='Transformer INT4 example for MPT model')
 | 
					    parser = argparse.ArgumentParser(description='Transformer INT4 example for MPT model')
 | 
				
			||||||
    parser.add_argument('--repo-id-or-model-path', type=str, default="mosaicml/mpt-7b-chat",
 | 
					    parser.add_argument('--repo-id-or-model-path', type=str, default="mosaicml/mpt-7b-chat",
 | 
				
			||||||
                        help='The huggingface repo id for the large language model to be downloaded'
 | 
					                        help='The huggingface repo id for the MPT to be downloaded'
 | 
				
			||||||
                             ', or the path to the huggingface checkpoint folder')
 | 
					                             ', or the path to the huggingface checkpoint folder')
 | 
				
			||||||
    parser.add_argument('--prompt', type=str, default="<human>What is AI?<bot>",
 | 
					    parser.add_argument('--prompt', type=str, default="What is AI?",
 | 
				
			||||||
                        help='Prompt to infer')
 | 
					                        help='Prompt to infer')
 | 
				
			||||||
    parser.add_argument('--n-predict', type=int, default=32,
 | 
					    parser.add_argument('--n-predict', type=int, default=32,
 | 
				
			||||||
                        help='Max tokens to predict')
 | 
					                        help='Max tokens to predict')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue