made inference server a bit more robust

This commit is contained in:
Yannic Kilcher
2023-01-26 21:01:52 +01:00
parent 2eed530e1a
commit 040344a41f
2 changed files with 60 additions and 36 deletions
+7 -1
View File
@@ -33,7 +33,13 @@ def main(
# construct prompt
messages = [_prepare_message(message) for message in work_request.conversation.messages]
prompt = "\n".join(messages) + "\nAssistant:"
prefix = (
"The following is a conversation between a user and an assistant. "
"The assistant is helpful, creative, clever, and very friendly.\n"
"Assistant: Hello! How can I help you today?\n"
)
prompt = prefix + "\n".join(messages) + "\nAssistant:"
# TODO: use the seed
# torch.manual_seed(work_request.seed)