Closed StreamlinedStartup closed 8 months ago
format_prompt was defined as a function above, simply rename the boolean argument:
def generate(self, prompt, flag_format_prompt: bool = True):
if flag_format_prompt:
formatted_prompt = format_prompt(
prompt=prompt,
prompt_template=self.prompt_template,
system_message=self.system_message,
)
tokens = get_tokens(formatted_prompt if flag_format_prompt else prompt)
self.params["n_predict"] = int(self.max_tokens) - tokens
self.params["n_ctx"] = int(self.max_tokens) - tokens
llm = Llama(**self.params)
data = llm(prompt=formatted_prompt if flag_format_prompt else prompt)
data["model"] = self.model_name
return data
That is what I get for trying to add some quick functionality! It has been updated to fix this issue. Thank you for reporting. Please update and the issue will be gone.
Getting a 500 error when using internal_ip/v1/chat/completions and default env variables. Any help would be greatly appreciated!
Request:
Docker Logs: