Skip to content

Commit 26d5dfc

Browse files
committed
addressing PR comments
1 parent cb754f2 commit 26d5dfc

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

test/backends/test_huggingface.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ def session(backend):
3737
yield session
3838
session.reset()
3939

40-
@pytest.mark.qualitative
40+
4141
def test_system_prompt(session):
4242
result = session.chat(
4343
"Where are we going?",
4444
model_options={ModelOption.SYSTEM_PROMPT: "Talk like a pirate."},
4545
)
4646
print(result)
4747

48-
@pytest.mark.qualitative
48+
4949
def test_constraint_alora(session, backend):
5050
answer = session.instruct(
5151
"Corporate wants you to find the difference between these two strings: aaaaaaaaaa aaaaabaaaa. Be concise and don't write code to answer the question.",
@@ -63,7 +63,7 @@ def test_constraint_alora(session, backend):
6363
)
6464
assert alora_output in ["Y", "N"], alora_output
6565

66-
@pytest.mark.qualitative
66+
6767
def test_constraint_lora_with_requirement(session, backend):
6868
answer = session.instruct(
6969
"Corporate wants you to find the difference between these two strings: aaaaaaaaaa aaaaabaaaa"
@@ -79,6 +79,7 @@ def test_constraint_lora_with_requirement(session, backend):
7979
assert isinstance(val_result, ValidationResult)
8080
assert str(val_result.reason) in ["Y", "N"]
8181

82+
8283
@pytest.mark.qualitative
8384
def test_constraint_lora_override(session, backend):
8485
backend.default_to_constraint_checking_alora = False # type: ignore
@@ -94,6 +95,7 @@ def test_constraint_lora_override(session, backend):
9495
assert isinstance(default_output_to_bool(str(val_result.reason)), bool)
9596
backend.default_to_constraint_checking_alora = True
9697

98+
9799
@pytest.mark.qualitative
98100
def test_constraint_lora_override_does_not_override_alora(session, backend):
99101
backend.default_to_constraint_checking_alora = False # type: ignore
@@ -111,6 +113,7 @@ def test_constraint_lora_override_does_not_override_alora(session, backend):
111113
assert str(val_result.reason) in ["Y", "N"]
112114
backend.default_to_constraint_checking_alora = True
113115

116+
114117
@pytest.mark.qualitative
115118
def test_llmaj_req_does_not_use_alora(session, backend):
116119
backend.default_to_constraint_checking_alora = True # type: ignore
@@ -127,11 +130,12 @@ def test_llmaj_req_does_not_use_alora(session, backend):
127130
assert isinstance(val_result, ValidationResult)
128131
assert str(val_result.reason) not in ["Y", "N"]
129132

130-
@pytest.mark.qualitative
133+
131134
def test_instruct(session):
132135
result = session.instruct("Compute 1+1.")
133136
print(result)
134137

138+
135139
@pytest.mark.qualitative
136140
def test_multiturn(session):
137141
session.instruct("Compute 1+1")
@@ -142,6 +146,7 @@ def test_multiturn(session):
142146
words = session.instruct("Now list five English words that start with that letter.")
143147
print(words)
144148

149+
145150
@pytest.mark.qualitative
146151
def test_format(session):
147152
class Person(pydantic.BaseModel):
@@ -172,7 +177,7 @@ class Email(pydantic.BaseModel):
172177
"The email address should be at example.com"
173178
)
174179

175-
@pytest.mark.qualitative
180+
176181
def test_generate_from_raw(session):
177182
prompts = ["what is 1+1?", "what is 2+2?", "what is 3+3?", "what is 4+4?"]
178183

@@ -182,6 +187,7 @@ def test_generate_from_raw(session):
182187

183188
assert len(results) == len(prompts)
184189

190+
185191
@pytest.mark.qualitative
186192
def test_generate_from_raw_with_format(session):
187193
prompts = ["what is 1+1?", "what is 2+2?", "what is 3+3?", "what is 4+4?"]

test/stdlib_basics/test_contextual_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def test_all_convenience_functions(model_id):
160160

161161
def test_session_with_parameters(model_id):
162162
"""Test contextual session with custom parameters."""
163-
with start_session(backend_name="ollama", model_id=META_LLAMA_3_2_1B) as m:
163+
with start_session(backend_name="ollama", model_id=model_id) as m:
164164
result = instruct("test with parameters")
165165
assert isinstance(result, ModelOutputThunk)
166166
assert isinstance(m, MelleaSession)

0 commit comments

Comments
 (0)