2121@pytest .fixture (scope = "module" )
2222def backend ():
2323 """Shared HuggingFace backend for all tests in this module."""
24- # TODO: find a smalle 1B model to do Alora stuff on github actions.
2524 backend = LocalHFBackend (
2625 model_id = "ibm-granite/granite-3.2-8b-instruct" ,
2726 formatter = TemplateFormatter (model_id = "ibm-granite/granite-4.0-tiny-preview" ),
@@ -38,15 +37,15 @@ def session(backend):
3837 yield session
3938 session .reset ()
4039
41- @pytest .mark .llm
40+ @pytest .mark .qualitative
4241def test_system_prompt (session ):
4342 result = session .chat (
4443 "Where are we going?" ,
4544 model_options = {ModelOption .SYSTEM_PROMPT : "Talk like a pirate." },
4645 )
4746 print (result )
4847
49- @pytest .mark .llm
48+ @pytest .mark .qualitative
5049def test_constraint_alora (session , backend ):
5150 answer = session .instruct (
5251 "Corporate wants you to find the difference between these two strings: aaaaaaaaaa aaaaabaaaa. Be concise and don't write code to answer the question." ,
@@ -64,7 +63,7 @@ def test_constraint_alora(session, backend):
6463 )
6564 assert alora_output in ["Y" , "N" ], alora_output
6665
67- @pytest .mark .llm
66+ @pytest .mark .qualitative
6867def test_constraint_lora_with_requirement (session , backend ):
6968 answer = session .instruct (
7069 "Corporate wants you to find the difference between these two strings: aaaaaaaaaa aaaaabaaaa"
@@ -80,7 +79,7 @@ def test_constraint_lora_with_requirement(session, backend):
8079 assert isinstance (val_result , ValidationResult )
8180 assert str (val_result .reason ) in ["Y" , "N" ]
8281
83- @pytest .mark .llm
82+ @pytest .mark .qualitative
8483def test_constraint_lora_override (session , backend ):
8584 backend .default_to_constraint_checking_alora = False # type: ignore
8685 answer = session .instruct (
@@ -95,7 +94,7 @@ def test_constraint_lora_override(session, backend):
9594 assert isinstance (default_output_to_bool (str (val_result .reason )), bool )
9695 backend .default_to_constraint_checking_alora = True
9796
98- @pytest .mark .llm
97+ @pytest .mark .qualitative
9998def test_constraint_lora_override_does_not_override_alora (session , backend ):
10099 backend .default_to_constraint_checking_alora = False # type: ignore
101100 answer = session .instruct (
@@ -112,7 +111,7 @@ def test_constraint_lora_override_does_not_override_alora(session, backend):
112111 assert str (val_result .reason ) in ["Y" , "N" ]
113112 backend .default_to_constraint_checking_alora = True
114113
115- @pytest .mark .llm
114+ @pytest .mark .qualitative
116115def test_llmaj_req_does_not_use_alora (session , backend ):
117116 backend .default_to_constraint_checking_alora = True # type: ignore
118117 answer = session .instruct (
@@ -128,12 +127,12 @@ def test_llmaj_req_does_not_use_alora(session, backend):
128127 assert isinstance (val_result , ValidationResult )
129128 assert str (val_result .reason ) not in ["Y" , "N" ]
130129
131- @pytest .mark .llm
130+ @pytest .mark .qualitative
132131def test_instruct (session ):
133132 result = session .instruct ("Compute 1+1." )
134133 print (result )
135134
136- @pytest .mark .llm
135+ @pytest .mark .qualitative
137136def test_multiturn (session ):
138137 session .instruct ("Compute 1+1" )
139138 beta = session .instruct (
@@ -143,7 +142,7 @@ def test_multiturn(session):
143142 words = session .instruct ("Now list five English words that start with that letter." )
144143 print (words )
145144
146- @pytest .mark .llm
145+ @pytest .mark .qualitative
147146def test_format (session ):
148147 class Person (pydantic .BaseModel ):
149148 name : str
@@ -173,7 +172,7 @@ class Email(pydantic.BaseModel):
173172 "The email address should be at example.com"
174173 )
175174
176- @pytest .mark .llm
175+ @pytest .mark .qualitative
177176def test_generate_from_raw (session ):
178177 prompts = ["what is 1+1?" , "what is 2+2?" , "what is 3+3?" , "what is 4+4?" ]
179178
@@ -183,7 +182,7 @@ def test_generate_from_raw(session):
183182
184183 assert len (results ) == len (prompts )
185184
186- @pytest .mark .llm
185+ @pytest .mark .qualitative
187186def test_generate_from_raw_with_format (session ):
188187 prompts = ["what is 1+1?" , "what is 2+2?" , "what is 3+3?" , "what is 4+4?" ]
189188
0 commit comments