-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
21 changed files
with
556 additions
and
580 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 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
Large diffs are not rendered by default.
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
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,5 +1,4 @@ | ||
from .._model import Chat, Instruct | ||
# from ._local import Local | ||
from .._remote import Remote | ||
|
||
|
||
|
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,5 +1,5 @@ | ||
from guidance import models, any_char | ||
|
||
def test_single_char(): | ||
model = models.LocalMock("<s>abc") | ||
model = models.Mock("<s>abc") | ||
assert str(model + '<s>' + any_char()) == "<s>a" |
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,12 +1,12 @@ | ||
from guidance import models, any_char_but | ||
|
||
def test_single_char(): | ||
model = models.LocalMock("<s>abc") | ||
model = models.Mock("<s>abc") | ||
assert str(model + '<s>' + any_char_but('a')) != "<s>a" | ||
assert str(model + '<s>' + any_char_but('!')) == "<s>a" | ||
|
||
def test_multi_char(): | ||
model = models.LocalMock(["<s>abc", "<s>bbc"]) | ||
model = models.Mock(["<s>abc", "<s>bbc"]) | ||
assert str(model + '<s>' + any_char_but('ab')) not in ("<s>a", "<s>b") | ||
assert str(model + '<s>' + any_char_but('a!')) == "<s>b" | ||
assert str(model + '<s>' + any_char_but('5b')) == "<s>a" |
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 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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
from guidance import models, one_or_more, char_set | ||
|
||
def test_string(): | ||
model = models.LocalMock("<s>aaabc") | ||
model = models.Mock("<s>aaabc") | ||
assert str(model + '<s>' + one_or_more("a")) == "<s>aaa" | ||
|
||
def test_grammar(): | ||
model = models.LocalMock("<s>bac") | ||
model = models.Mock("<s>bac") | ||
assert str(model + '<s>' + one_or_more(char_set("ab"))) == "<s>ba" | ||
|
||
def test_at_least_one(): | ||
model = models.LocalMock("<s>cbac") | ||
model = models.Mock("<s>cbac") | ||
assert not str(model + '<s>' + one_or_more(char_set("ab"))).startswith("<s>c") |
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.
Oops, something went wrong.