From c711f68f245a3981a4956b3c15ee9a03227bed98 Mon Sep 17 00:00:00 2001 From: Philip Mohun Date: Thu, 23 Jul 2020 01:06:39 -0400 Subject: [PATCH] Update calvin.py added preset for _engine in initialize method updated hyperparameter settings for complete_prompt method --- calvin/calvin.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/calvin/calvin.py b/calvin/calvin.py index c3161d8..8b867e6 100644 --- a/calvin/calvin.py +++ b/calvin/calvin.py @@ -1,9 +1,9 @@ import json import requests -# # # # -# Calvin - abstraction module over openai's API # -# # # # +# # # # +# Calvin - abstraction module over openai's API # +# # # # # Defile module-scoped variables @@ -13,7 +13,7 @@ # Initialize module -def initialize(_api_key, _engine): +def initialize(_api_key, _engine=engine): global engine, headers, prompts if _engine: @@ -86,8 +86,8 @@ def create_completion(payload): def complete_prompt(prompt): payload = { "prompt": prompt, - "max_tokens": 5, - "temperature": 1, + "max_tokens": 150, + "temperature": 0.9, "top_p": 1, "n": 1 } @@ -143,4 +143,4 @@ def test_create_completion(): "logprobs": null, "stop": "\n" } -""" \ No newline at end of file +"""