Made the frontend more flexible to also support other models than just Koala

This commit is contained in:
Julian Müller (ChaoticByte) 2023-05-18 15:54:41 +02:00
parent c3fda61b21
commit 7590c31f89
3 changed files with 4 additions and 4 deletions

View file

@ -25,7 +25,7 @@ if __name__ == "__main__":
assert "conversation_prefix" in profile assert "conversation_prefix" in profile
assert "user_keyword" in profile assert "user_keyword" in profile
assert "assistant_keyword" in profile assert "assistant_keyword" in profile
assert "stop_sequence" in profile assert "stop_sequences" in profile
# Pass frontend config to the app # Pass frontend config to the app
app.config.frontend_config = { app.config.frontend_config = {
"api_url": args.api.rstrip("/"), "api_url": args.api.rstrip("/"),
@ -34,7 +34,7 @@ if __name__ == "__main__":
"conversation_prefix": profile["conversation_prefix"], "conversation_prefix": profile["conversation_prefix"],
"user_keyword": profile["user_keyword"], "user_keyword": profile["user_keyword"],
"assistant_keyword": profile["assistant_keyword"], "assistant_keyword": profile["assistant_keyword"],
"stop_sequence": profile["stop_sequence"] "stop_sequences": profile["stop_sequences"]
} }
} }
# Run # Run

View file

@ -34,7 +34,7 @@ fetch("/config")
async function apiCompletion(prompt, settings) { async function apiCompletion(prompt, settings) {
const bodyData = JSON.stringify({ const bodyData = JSON.stringify({
"prompt": prompt, "prompt": prompt,
"stop": [frontend_config.profile.stop_sequence], "stop": frontend_config.profile.stop_sequences,
"max_tokens": settings.max_tokens, "max_tokens": settings.max_tokens,
"temperature": settings.temperature, "temperature": settings.temperature,
"top_p": settings.top_p, "top_p": settings.top_p,

View file

@ -3,5 +3,5 @@
"conversation_prefix": "BEGINNING OF CONVERSATION: ", "conversation_prefix": "BEGINNING OF CONVERSATION: ",
"user_keyword": "USER:", "user_keyword": "USER:",
"assistant_keyword": "GPT:", "assistant_keyword": "GPT:",
"stop_sequence": "</s>" "stop_sequences": ["</s>"]
} }