From 7590c31f896df1e4cceea3ab0c51cbdd5bf662cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=BCller=20=28ChaoticByte=29?= Date: Thu, 18 May 2023 15:54:41 +0200 Subject: [PATCH] Made the frontend more flexible to also support other models than just Koala --- frontend-server.py | 4 ++-- frontend/static/main.js | 2 +- profiles/koala.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend-server.py b/frontend-server.py index a0fa3e6..e631058 100644 --- a/frontend-server.py +++ b/frontend-server.py @@ -25,7 +25,7 @@ if __name__ == "__main__": assert "conversation_prefix" in profile assert "user_keyword" in profile assert "assistant_keyword" in profile - assert "stop_sequence" in profile + assert "stop_sequences" in profile # Pass frontend config to the app app.config.frontend_config = { "api_url": args.api.rstrip("/"), @@ -34,7 +34,7 @@ if __name__ == "__main__": "conversation_prefix": profile["conversation_prefix"], "user_keyword": profile["user_keyword"], "assistant_keyword": profile["assistant_keyword"], - "stop_sequence": profile["stop_sequence"] + "stop_sequences": profile["stop_sequences"] } } # Run diff --git a/frontend/static/main.js b/frontend/static/main.js index f56cc78..b1e27b3 100644 --- a/frontend/static/main.js +++ b/frontend/static/main.js @@ -34,7 +34,7 @@ fetch("/config") async function apiCompletion(prompt, settings) { const bodyData = JSON.stringify({ "prompt": prompt, - "stop": [frontend_config.profile.stop_sequence], + "stop": frontend_config.profile.stop_sequences, "max_tokens": settings.max_tokens, "temperature": settings.temperature, "top_p": settings.top_p, diff --git a/profiles/koala.json b/profiles/koala.json index 34b1c19..78790f9 100644 --- a/profiles/koala.json +++ b/profiles/koala.json @@ -3,5 +3,5 @@ "conversation_prefix": "BEGINNING OF CONVERSATION: ", "user_keyword": "USER:", "assistant_keyword": "GPT:", - "stop_sequence": "" + "stop_sequences": [""] } \ No newline at end of file