Skip to content

Commit

Permalink
feat: update OpenAI lib and support for gpt-4o-mini
Browse files Browse the repository at this point in the history
  • Loading branch information
pprobst committed Aug 22, 2024
1 parent e90d120 commit bf29b5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ deep-translator==1.11.4
transformers==4.9.1
sentencepiece==0.1.99
tenacity==8.2.3
openai==1.3.5
openai==1.42.0
nlpaug==1.1.11
nltk==3.6.6
num2words==0.5.13
Expand Down
2 changes: 1 addition & 1 deletion run_txt_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
parser.add_argument(
"--model",
type=str,
default="gpt-3.5-turbo-0125",
default="gpt-4o-mini",
help="ChatGPT model to use",
)
parser.add_argument(
Expand Down
3 changes: 2 additions & 1 deletion text/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
# https://platform.openai.com/docs/models/gpt-3-5
"gpt-4-turbo": 128000,
"gpt-3.5-turbo-0125": 16385,
"gpt-4o-mini": 128000,
}


# https://github.com/openai/openai-cookbook/blob/main/examples/How_to_handle_rate_limits.ipynb
@retry(wait=wait_random_exponential(min=1, max=60), stop=stop_after_attempt(6))
def make_chatgpt_query(
client, query: str, return_type: str, model: str = "gpt-3.5-turbo-0125"
client, query: str, return_type: str, model: str = "gpt-4o-mini"
) -> List[str]:
"""
Makes a query to the ChatGPT model and returns the generated response.
Expand Down

0 comments on commit bf29b5a

Please sign in to comment.