Skip to content

Commit

Permalink
Update calvin.py
Browse files Browse the repository at this point in the history
added preset for _engine in initialize method
updated hyperparameter settings for complete_prompt method
  • Loading branch information
pmohun authored Jul 23, 2020
1 parent 3592e42 commit c711f68
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions calvin/calvin.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,7 +13,7 @@


# Initialize module
def initialize(_api_key, _engine):
def initialize(_api_key, _engine=engine):
global engine, headers, prompts

if _engine:
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -143,4 +143,4 @@ def test_create_completion():
"logprobs": null,
"stop": "\n"
}
"""
"""

0 comments on commit c711f68

Please sign in to comment.