Prompt formatting
The following code gives an example of automatically formatting a prompt during inference to match the expected format for the given model. Note, not all models include aprompt_format
; make sure you validate that a prompt format is present in your code.
python
Grammar correction
Try RedPajama-INCITE-Chat-3B to correct sentences to standard English.- For example, begin the prompt by asking to correct the grammar of a sentence:
- Prompt 1
- Prompt 2
Correct this to standard English:
I no Sandwich want.
- Sample response
- Response 1
- Response 2
I don’t want a sandwich.
- Send the prompt to the API with any appropriate parameters. The code below shows an example in Python using the
requests
package.
python