(s)
| 29 | CONTROLLER_ADDR = os.environ.get('CONTROLLER_ADDR', '').split(',') |
| 30 | |
| 31 | def clean(s): |
| 32 | clean_toks = ['\n', '\t'] |
| 33 | for tok in clean_toks: |
| 34 | s = s.replace(tok, ' ') |
| 35 | return s |
| 36 | |
| 37 | def num_tokens_from_messages(messages, model="gpt-3.5-turbo-0613"): |
| 38 | """Return the number of tokens used by a list of messages.""" |