Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

patch web UI (#484)

Charles Packer8a7a64c7f9a0
diff --git a/memgpt/local_llm/webui/api.py b/memgpt/local_llm/webui/api.py
index 29a859969..710b31883 100644
--- a/memgpt/local_llm/webui/api.py
+++ b/memgpt/local_llm/webui/api.py
@@ -18,8 +18,9 @@ def get_webui_completion(endpoint, prompt, context_window, settings=SIMPLE, gram
# Settings for the generation, includes the prompt + stop tokens, max length, etc
request = settings
request["prompt"] = prompt
- request["max_tokens"] = context_window
- # request["truncation_length"] = context_window
+ request["truncation_length"] = context_window
+ request["max_tokens"] = int(context_window - prompt_tokens)
+ request["max_new_tokens"] = int(context_window - prompt_tokens) # safety backup to "max_tokens", shouldn't matter
# Set grammar
if grammar is not None:
diff --git a/memgpt/local_llm/webui/settings.py b/memgpt/local_llm/webui/settings.py
index 806540744..57c775489 100644
--- a/memgpt/local_llm/webui/settings.py
+++ b/memgpt/local_llm/webui/settings.py
@@ -1,7 +1,8 @@
from ...constants import LLM_MAX_TOKENS
SIMPLE = {
- "stopping_strings": [
+ # "stopping_strings": [
+ "stop": [
"\nUSER:",
"\nASSISTANT:",
"\nFUNCTION RETURN:",