Google 《Prompt Engineering v7》
Prompt Engineering Author: Lee Boonstra Prompt Engineering February 2025 2 Acknowledgements Content contributors Michael Sherman Yuan Cao Erick Armbrust Anant Nawalgaria Antonio Gulli Simone Cammel Nawalgaria Grace Mollison Technical Writer Joey Haymaker Designer Michael Lanning Introduction 6 Prompt engineering 7 LLM output configuration 8 Output length 8 Sampling controls 9 Temperature 9 Top-K Thought (CoT) 29 Self-consistency 32 Tree of Thoughts (ToT) 36 ReAct (reason & act) 37 Automatic Prompt Engineering 40 Code prompting 42 Prompts for writing code 42 Prompts for explaining code 44 Prompts0 码力 | 68 页 | 6.50 MB | 6 月前3AI大模型千问 qwen 中文文档
shown␣ �→below prompt = "Give me a short introduction to large language model." messages = [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": prompt} ] text = tokenizer tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) model_inputs = tokenizer([text], return_tensors="pt").to(device) # Directly use generate() and tokenizer.decode() to the last code snippet from transformers import TextStreamer streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True) generated_ids = model.generate( model_inputs.input_ids, max_new_tokens=5120 码力 | 56 页 | 835.78 KB | 1 年前3Conda 4.6.0 Documentation
across platforms and operating systems. To install conda packages, in the Terminal or an Anaconda Prompt, run: 4 Chapter 1. User guide conda Documentation, Release 4.6.0 conda install [packagename] powerful package manager and environment manager that you use with command line commands at the Anaconda Prompt for Windows, or in a Terminal window for macOS or Linux. This 20-minute guide to getting started search for and open “Anaconda Prompt”. 1.3. Getting started with conda 5 conda Documentation, Release 4.6.0 On Windows, all commands below are typed into the Anaconda Prompt window. MacOS • Open Launchpad0 码力 | 190 页 | 728.67 KB | 7 月前3Conda 4.6.1 Documentation
across platforms and operating systems. To install conda packages, in the Terminal or an Anaconda Prompt, run: 4 Chapter 1. User guide conda Documentation, Release 4.6.1 conda install [packagename] powerful package manager and environment manager that you use with command line commands at the Anaconda Prompt for Windows, or in a Terminal window for macOS or Linux. This 20-minute guide to getting started search for and open “Anaconda Prompt”. 1.3. Getting started with conda 5 conda Documentation, Release 4.6.1 On Windows, all commands below are typed into the Anaconda Prompt window. MacOS • Open Launchpad0 码力 | 190 页 | 728.57 KB | 7 月前3Conda 23.3.x Documentation
post2+bdcba5dd0 1.1.7 Installing with conda To install conda packages, in the terminal or an Anaconda Prompt, run: 24 Chapter 1. User guide conda Documentation, Release 23.3.1.post2+bdcba5dd0 conda install powerful package manager and environment manager that you use with command line commands at the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux. This 20-minute guide to getting started Windows • From the Start menu, search for and open "Anaconda Prompt." On Windows, all commands below are typed into the Anaconda Prompt window. MacOS • Open Launchpad, then click the terminal icon0 码力 | 370 页 | 2.94 MB | 7 月前3Conda 23.5.x Documentation
dev0+placeholder 1.1.7 Installing with conda To install conda packages, in the terminal or an Anaconda Prompt, run: 24 Chapter 1. User guide conda Documentation, Release 0.0.0.dev0+placeholder conda install powerful package manager and environment manager that you use with command line commands at the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux. This 20-minute guide to getting started Windows • From the Start menu, search for and open "Anaconda Prompt." On Windows, all commands below are typed into the Anaconda Prompt window. MacOS • Open Launchpad, then click the terminal icon0 码力 | 370 页 | 3.11 MB | 7 月前3Ubuntu Server Guide 18.04
Ubuntu web site4. • Boot the system from media (e.g. USB key) containing the ISO file. • At the boot prompt you will be asked to select a language. • From the main boot menu there are some additional options Ubuntu web site7. • Boot the system from media (e.g. USB key) containing the ISO file. • At the boot prompt you will be asked to select a language. • From the main boot menu there are some additional options during installation you are not satisfied by the default setting, use the "Go Back" function at any prompt to be brought to a detailed installation menu that will allow you to modify the default settings0 码力 | 413 页 | 1.40 MB | 1 年前3Click Documentation Release 1.2.dev0
command() @click.option('--count', default=1, help='Number of greetings.') @click.option('--name', prompt='Your name', help='The person to greet.') def hello(count, name): """Simple program that greets for user input. This can be implemented with click by defining a prompt string. Example: @click.command() @click.option('--name', prompt=True) def hello(name): click.echo('Hello %s!' % name) And what John Hello John! If you are not happy with the default prompt string you can ask for a different one: @click.command() @click.option('--name', prompt='Your name please') def hello(name): click.echo('Hello0 码力 | 64 页 | 301.16 KB | 1 年前3Click Documentation Release 2.6
command() @click.option('--count', default=1, help='Number of greetings.') @click.option('--name', prompt='Your name', help='The person to greet.') def hello(count, name): """Simple program that greets input instead. This can be implemented with click by defining a prompt string. Example: @click.command() @click.option('--name', prompt=True) def hello(name): click.echo('Hello %s!' % name) And what John Hello John! If you are not happy with the default prompt string, you can ask for a different one: @click.command() @click.option('--name', prompt='Your name please') def hello(name): click.echo('Hello0 码力 | 83 页 | 354.87 KB | 1 年前3Click Documentation Release 6.7
command() @click.option('--count', default=1, help='Number of greetings.') @click.option('--name', prompt='Your name', help='The person to greet.') def hello(count, name): """Simple program that greets how the prompt of your shell has changed to show the active environment). And if you want to go back to the real world, use the following command: $ deactivate After doing this, the prompt of your shell input instead. This can be implemented with Click by defining a prompt string. Example: @click.command() @click.option('--name', prompt=True) def hello(name): click.echo('Hello %s!' % name) And what0 码力 | 107 页 | 428.42 KB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100