Spaces:
Sleeping
Sleeping
Commit
·
253707d
1
Parent(s):
4f9db67
OK, try this
Browse files
app.py
CHANGED
@@ -35,13 +35,14 @@ Analyze the following IDA Hex Rays pseudocode and generate a valid JSON object c
|
|
35 |
|
36 |
@spaces.GPU
|
37 |
def predict(code):
|
|
|
|
|
|
|
|
|
|
|
38 |
# Prepare messages with system prompt
|
39 |
-
messages =
|
40 |
-
|
41 |
-
{"role": "user", "content": "Hello, how are you?"}
|
42 |
-
]
|
43 |
-
print(f"Test Tokenize: {tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)}")
|
44 |
-
return pipe(code)
|
45 |
|
46 |
demo = gr.Interface(fn=predict, inputs="text", outputs="text",
|
47 |
description=frontmatter.load("README.md").content)
|
|
|
35 |
|
36 |
@spaces.GPU
|
37 |
def predict(code):
|
38 |
+
prompt = """{system}
|
39 |
+
[INST]
|
40 |
+
{code}
|
41 |
+
[/INST]
|
42 |
+
"""
|
43 |
# Prepare messages with system prompt
|
44 |
+
#print(f"Test Tokenize: {tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)}")
|
45 |
+
return pipe(prompt)
|
|
|
|
|
|
|
|
|
46 |
|
47 |
demo = gr.Interface(fn=predict, inputs="text", outputs="text",
|
48 |
description=frontmatter.load("README.md").content)
|