Skip to content

Commit

Permalink
Disable the compress-messages code for now
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed May 16, 2024
1 parent 8ef9774 commit a7ca4f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions r2ai/large.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .models import get_hf_llm, new_get_hf_llm, get_default_model
import re
import json

class Large:
Expand Down Expand Up @@ -140,6 +141,7 @@ def compress_code_ai(self, code):
return "\n".join(res)

def compress_messages(self, messages):
return messages
# TODO: implement a better logic in here asking the lm to summarize the context
olen = 0
msglen = 0
Expand Down
4 changes: 3 additions & 1 deletion r2ai/repl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import builtins
from r2ai.models import set_default_model
from .large import Large
from .utils import slurp
import traceback
have_readline = False
Expand Down Expand Up @@ -302,6 +301,9 @@ def runline(ai, usertext):
print("Cannot load file", file=sys.stderr)
elif usertext.startswith("-i"):
text = usertext[2:].strip()
if text == "":
print("Usage: r2ai -i [file] [question]")
return
words = text.split(" ", 1)
res = slurp(words[0])
if len(words) > 1:
Expand Down

0 comments on commit a7ca4f6

Please sign in to comment.