Browse Source

fix

pull/3/head
officeyutong 2 years ago
parent
commit
a7da5a16ac
2 changed files with 8 additions and 9 deletions
  1. +8
    -3
      GPTtrace.py
  2. +0
    -6
      requirements.txt

+ 8
- 3
GPTtrace.py View File

@@ -20,9 +20,12 @@ ENV_ACCESS_TOKEN = "GPTTRACE_ACCESS_TOKEN"
PROMPTS_DIR = Path("./prompts")


def pretty_print(input, lexer=MarkdownLexer):
def pretty_print(input, lexer=MarkdownLexer, *args, **kwargs):
tokens = list(pygments.lex(input, lexer=lexer()))
print_formatted_text(PygmentsTokens(tokens))
print_formatted_text(PygmentsTokens(tokens), *args, **kwargs)


# print = pretty_print


def main():
@@ -48,6 +51,9 @@ def main():
group.add_argument(
"--train", help="Train ChatGPT with conversions we provided", action="store_true")

parser.add_argument("-v", "--verbose",
help="Show more details", action="store_true")

parser.add_argument(
"-u",
"--uuid",
@@ -120,7 +126,6 @@ No explanation required, no instruction required, don't tell me how to compile a
What I want is a eBPF program for: {text}."""



def construct_running_prompt(text: str) -> str:
return f"""You are now a translater from human language to {os.uname()[0]} shell bpftrace command.
No explanation required.


+ 0
- 6
requirements.txt View File

@@ -2,11 +2,9 @@ anyio==3.6.2
astroid==2.14.2
asyncio==3.4.3
autopep8==2.0.1
black==23.1.0
blobfile==2.0.1
certifi==2022.12.7
charset-normalizer==3.0.1
click==8.1.3
dill==0.3.6
filelock==3.9.0
flake8==6.0.0
@@ -19,11 +17,7 @@ lazy-object-proxy==1.9.0
lxml==4.9.2
marko==1.3.0
mccabe==0.7.0
mypy-extensions==1.0.0
OpenAIAuth==0.2.0
packaging==23.0
pathspec==0.11.0
pkg_resources==0.0.0
platformdirs==3.0.0
prompt-toolkit==3.0.36
pycodestyle==2.10.0


Loading…
Cancel
Save