Skip to content

Commit 482e725

Browse files
committed
fix: apply review suggestions
1 parent 3dcff99 commit 482e725

File tree

4 files changed

+3
-63
lines changed

4 files changed

+3
-63
lines changed

tests/constants.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/test_configs/autoalign/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
models:
22
- type: main
3-
engine: nemollm
4-
model: gpt-43b-002
3+
engine: openai
4+
model: gpt-3.5-turbo-instruct
55

66
rails:
77
config:

tests/test_configs/fact_checking/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
models:
22
- type: main
33
engine: openai
4-
model: gpt-3.5-instruct-turbo
4+
model: gpt-3.5-turbo-instruct
55

66
rails:
77
config:

tests/test_fact_checking.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from nemoguardrails import RailsConfig
2222
from nemoguardrails.actions.actions import ActionResult, action
2323
from nemoguardrails.llm.providers.trtllm import llm
24-
from tests.constants import NEMO_API_URL_GPT_43B_002
2524
from tests.utils import TestChat
2625

2726
CONFIGS_FOLDER = os.path.join(os.path.dirname(__file__), ".", "test_configs")
@@ -113,43 +112,6 @@ async def test_fact_checking_wrong(httpx_mock):
113112
await chat.bot_async("I don't know the answer to that.")
114113

115114

116-
# TODO: fix this!
117-
@pytest.mark.skip(reason="Not sure why it fails.")
118-
@pytest.mark.asyncio
119-
async def test_fact_checking_uncertain(httpx_mock):
120-
# Test 4 - Factual statement - AlignScore not very confident in its prediction
121-
config = RailsConfig.from_path(os.path.join(CONFIGS_FOLDER, "fact_checking"))
122-
chat = TestChat(config)
123-
chat.app.register_action(retrieve_relevant_chunks, "retrieve_relevant_chunks")
124-
125-
httpx_mock.add_response(
126-
method="POST",
127-
url=NEMO_API_URL_GPT_43B_002,
128-
json={"text": " ask about guardrails"},
129-
)
130-
131-
httpx_mock.add_response(
132-
method="POST",
133-
url=NEMO_API_URL_GPT_43B_002,
134-
json={
135-
"text": "NeMo Guardrails is a closed-source proprietary toolkit by Nvidia."
136-
},
137-
)
138-
139-
with aioresponses() as m:
140-
## Fact-checking using AlignScore
141-
m.post(
142-
"http://localhost:5000/alignscore_base",
143-
payload={"alignscore": 0.58},
144-
)
145-
146-
chat >> "What is NeMo Guardrails?"
147-
await chat.bot_async(
148-
"NeMo Guardrails is a closed-source proprietary toolkit by Nvidia.\n"
149-
+ "Attention: the answer above is potentially inaccurate."
150-
)
151-
152-
153115
@pytest.mark.asyncio
154116
async def test_fact_checking_fallback_to_self_check_correct(httpx_mock):
155117
# Test 4 - Factual statement - AlignScore endpoint not set up properly, use ask llm for fact-checking

0 commit comments

Comments
 (0)