-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from hangyav/feat/new_models
New instruction tuned models
- Loading branch information
Showing
9 changed files
with
330 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import pytest | ||
|
||
from textLSP.analysers.hf_instruction_checker import HFInstructionCheckerAnalyser | ||
from textLSP.documents.document import BaseDocument | ||
|
||
|
||
@pytest.fixture | ||
def analyser(): | ||
return HFInstructionCheckerAnalyser( | ||
None, | ||
{ | ||
HFInstructionCheckerAnalyser.CONFIGURATION_MODEL: 'grammarly/coedit-large', | ||
}, | ||
'hf_checker', | ||
) | ||
|
||
|
||
@pytest.mark.parametrize('doc,exp', [ | ||
( | ||
BaseDocument( | ||
'DUMMY_URL', | ||
'This is a short sentence.', | ||
version=1, | ||
), | ||
False, | ||
), | ||
( | ||
BaseDocument( | ||
'DUMMY_URL', | ||
'This is a long enough sentence with an eror or tvo.', | ||
version=1, | ||
), | ||
True, | ||
), | ||
]) | ||
def test_simple(doc, exp, analyser): | ||
res_diag, res_action = analyser._analyse_lines(doc.cleaned_source, doc) | ||
|
||
if exp: | ||
assert len(res_diag) > 0 | ||
assert len(res_action) > 0 | ||
else: | ||
assert len(res_diag) == 0 | ||
assert len(res_action) == 0 |
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 @@ | ||
from .hf_instruction_checker import HFInstructionCheckerAnalyser |
Oops, something went wrong.