Skip to content

Commit 6949b50

Browse files
authored
py : add grammar to oai like api (ggml-org#4294)
1 parent d7b800b commit 6949b50

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/server/api_like_OAI.py

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def make_postData(body, chat=False, stream=False):
7070
if(is_present(body, "mirostat_tau")): postData["mirostat_tau"] = body["mirostat_tau"]
7171
if(is_present(body, "mirostat_eta")): postData["mirostat_eta"] = body["mirostat_eta"]
7272
if(is_present(body, "seed")): postData["seed"] = body["seed"]
73+
if(is_present(body, "grammar")): postData["grammar"] = body["grammar"]
7374
if(is_present(body, "logit_bias")): postData["logit_bias"] = [[int(token), body["logit_bias"][token]] for token in body["logit_bias"].keys()]
7475
if (args.stop != ""):
7576
postData["stop"] = [args.stop]

0 commit comments

Comments
 (0)