Skip to content

Commit

Permalink
py : add grammar to oai like api (ggerganov#4294)
Browse files Browse the repository at this point in the history
  • Loading branch information
neph1 authored Dec 3, 2023
1 parent d7b800b commit 6949b50
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/server/api_like_OAI.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def make_postData(body, chat=False, stream=False):
if(is_present(body, "mirostat_tau")): postData["mirostat_tau"] = body["mirostat_tau"]
if(is_present(body, "mirostat_eta")): postData["mirostat_eta"] = body["mirostat_eta"]
if(is_present(body, "seed")): postData["seed"] = body["seed"]
if(is_present(body, "grammar")): postData["grammar"] = body["grammar"]
if(is_present(body, "logit_bias")): postData["logit_bias"] = [[int(token), body["logit_bias"][token]] for token in body["logit_bias"].keys()]
if (args.stop != ""):
postData["stop"] = [args.stop]
Expand Down

0 comments on commit 6949b50

Please sign in to comment.