add replicate support for max_tokens

This commit is contained in:
ishaan-jaff 2023-09-06 10:38:19 -07:00
parent ef43141554
commit d4c4a138ca
4 changed files with 11 additions and 4 deletions

View file

@ -108,10 +108,9 @@ def completion(
version_id = model_to_version_id(model)
input_data = {
"prompt": prompt,
"max_new_tokens": 50,
**optional_params
}
## LOGGING
logging_obj.pre_call(
input=prompt,
@ -142,6 +141,9 @@ def completion(
)
print_verbose(f"raw model_response: {result}")
if len(result) == 0: # edge case, where result from replicate is empty
result = " "
## Building RESPONSE OBJECT
model_response["choices"][0]["message"]["content"] = result