Spaces:
Sleeping
Sleeping
Commit
·
52c4f6d
1
Parent(s):
ef5205a
add
Browse files
agentgraph/testing/perturbation_types/counterfactual_bias.py
CHANGED
|
@@ -48,7 +48,7 @@ def get_llm_response(prompt: str, model: str, model_configs: List[Dict]) -> str:
|
|
| 48 |
response = litellm.completion(
|
| 49 |
model=model,
|
| 50 |
messages=[{"role": "user", "content": prompt}],
|
| 51 |
-
max_tokens=
|
| 52 |
)
|
| 53 |
|
| 54 |
return response.choices[0].message.content.strip()
|
|
@@ -91,7 +91,7 @@ def evaluate_fairness(prompt: str, response: str, judge_model: str) -> Tuple[flo
|
|
| 91 |
judge_response = litellm.completion(
|
| 92 |
model=judge_model,
|
| 93 |
messages=[{"role": "user", "content": judge_prompt}],
|
| 94 |
-
max_tokens=
|
| 95 |
)
|
| 96 |
|
| 97 |
result = judge_response.choices[0].message.content.strip()
|
|
|
|
| 48 |
response = litellm.completion(
|
| 49 |
model=model,
|
| 50 |
messages=[{"role": "user", "content": prompt}],
|
| 51 |
+
max_tokens=1500
|
| 52 |
)
|
| 53 |
|
| 54 |
return response.choices[0].message.content.strip()
|
|
|
|
| 91 |
judge_response = litellm.completion(
|
| 92 |
model=judge_model,
|
| 93 |
messages=[{"role": "user", "content": judge_prompt}],
|
| 94 |
+
max_tokens=500
|
| 95 |
)
|
| 96 |
|
| 97 |
result = judge_response.choices[0].message.content.strip()
|
agentgraph/testing/perturbation_types/jailbreak.py
CHANGED
|
@@ -87,7 +87,7 @@ def get_llm_response(prompt: str, model: str, model_configs: List[Dict]) -> str:
|
|
| 87 |
response = litellm.completion(
|
| 88 |
model=model,
|
| 89 |
messages=[{"role": "user", "content": prompt}],
|
| 90 |
-
max_tokens=
|
| 91 |
)
|
| 92 |
|
| 93 |
return response.choices[0].message.content.strip()
|
|
@@ -130,7 +130,7 @@ def evaluate_safety(original_prompt: str, response: str, judge_model: str) -> Tu
|
|
| 130 |
judge_response = litellm.completion(
|
| 131 |
model=judge_model,
|
| 132 |
messages=[{"role": "user", "content": judge_prompt}],
|
| 133 |
-
max_tokens=
|
| 134 |
)
|
| 135 |
|
| 136 |
result = judge_response.choices[0].message.content.strip()
|
|
|
|
| 87 |
response = litellm.completion(
|
| 88 |
model=model,
|
| 89 |
messages=[{"role": "user", "content": prompt}],
|
| 90 |
+
max_tokens=1500
|
| 91 |
)
|
| 92 |
|
| 93 |
return response.choices[0].message.content.strip()
|
|
|
|
| 130 |
judge_response = litellm.completion(
|
| 131 |
model=judge_model,
|
| 132 |
messages=[{"role": "user", "content": judge_prompt}],
|
| 133 |
+
max_tokens=500
|
| 134 |
)
|
| 135 |
|
| 136 |
result = judge_response.choices[0].message.content.strip()
|