-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
101 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from enum import Enum | ||
|
||
LLAMA2_INST_CLOSE = "[/INST]\n" | ||
|
||
# Standard Llama2 template | ||
TEMP_LLAMA2 = """ | ||
[INST]<<SYS>> | ||
{sys} | ||
{instr} | ||
{input} | ||
[/INST] | ||
""" | ||
|
||
|
||
SYS_1 = """You are a technical documentation writer. You always write clear, concise, and accurate documentation for | ||
scientific experiments. Your documentation focuses on the experiment's purpose, procedure, and results. Therefore, | ||
details about specific python functions, packages, or libraries are not necessary. Your readers are experimental | ||
scientists. | ||
""" | ||
|
||
INSTR_SWEETP_1 = """Please generate high-level two paragraph documentation for the following experiment. The first | ||
paragraph should explain the purpose and the second one the procedure, but don't use the word 'Paragraph'""" | ||
|
||
|
||
class SystemPrompts(Enum): | ||
SYS_1 = "SYS_1" | ||
|
||
|
||
class InstructionPrompts(Enum): | ||
SYS_1 = "SYS_1" | ||
INSTR_SWEETP_1 = "INSTR_SWEETP_1" | ||
|
||
|
||
SYS = {SystemPrompts.SYS_1: SYS_1} | ||
INSTR = {InstructionPrompts.INSTR_SWEETP_1: INSTR_SWEETP_1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
from autora.doc import example_module | ||
from autora.doc.runtime.predict_hf import Predictor | ||
|
||
|
||
def test_greetings() -> None: | ||
"""Verify the output of the `greetings` function""" | ||
output = example_module.greetings() | ||
assert output == "Hello from LINCC-Frameworks!" | ||
def test_trim_prompt() -> None: | ||
"""Verify the output of the `trim_prompt` function""" | ||
no_marker = "Generated text with no marker" | ||
output = Predictor.trim_prompt(no_marker) | ||
assert output == no_marker | ||
|
||
|
||
def test_meaning() -> None: | ||
"""Verify the output of the `meaning` function""" | ||
output = example_module.meaning() | ||
assert output == 42 | ||
with_marker = """ | ||
The prompt is here | ||
[/INST] | ||
output | ||
""" | ||
output = Predictor.trim_prompt(with_marker) | ||
assert output == "output\n" |