Skip to content

Instantly share code, notes, and snippets.

View garybpt's full-sized avatar

Gary Butterfield garybpt

View GitHub Profile
@pszemraj
pszemraj / inference_openai.py
Last active December 11, 2023 03:09
basic openai chat completion example
"""
inference_openai.py - text generation with OpenAI API
See https://platform.openai.com/docs/quickstart for more details.
Usage:
python inference_openai.py --prompt "The quick brown fox jumps over the lazy dog." --model "gpt-3.5-turbo" --temperature 0.5 --max_tokens 256 --n 1 --stop "."
Detailed usage:
python inference_openai.py --help