Commit
·
1439a1c
1
Parent(s):
5e2091b
fixing wrap text
Browse files
1_Auto_Generate_Prompts.py
CHANGED
@@ -13,6 +13,8 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStream
|
|
13 |
from peft import PeftModel
|
14 |
from huggingface_hub import login, whoami
|
15 |
|
|
|
|
|
16 |
st.title("Auto Red Teaming Demo for HI")
|
17 |
st.markdown(
|
18 |
"""
|
|
|
13 |
from peft import PeftModel
|
14 |
from huggingface_hub import login, whoami
|
15 |
|
16 |
+
|
17 |
+
st.set_page_config(layout="wide")
|
18 |
st.title("Auto Red Teaming Demo for HI")
|
19 |
st.markdown(
|
20 |
"""
|
pages/2_Select_Best_Prompts.py
CHANGED
@@ -7,6 +7,7 @@ from openai import OpenAI
|
|
7 |
from pydantic import BaseModel
|
8 |
from typing import List
|
9 |
|
|
|
10 |
st.title("Select Best Prompts")
|
11 |
|
12 |
def extract_json_content(markdown_str: str) -> str:
|
|
|
7 |
from pydantic import BaseModel
|
8 |
from typing import List
|
9 |
|
10 |
+
st.set_page_config(layout="wide")
|
11 |
st.title("Select Best Prompts")
|
12 |
|
13 |
def extract_json_content(markdown_str: str) -> str:
|
pages/3_Client_Response.py
CHANGED
@@ -5,6 +5,7 @@ import streamlit as st
|
|
5 |
import pandas as pd
|
6 |
from openai import OpenAI
|
7 |
|
|
|
8 |
st.title("Client Response (Answering)")
|
9 |
|
10 |
# Use best_samples if available; otherwise, fallback to the interactive single sample.
|
|
|
5 |
import pandas as pd
|
6 |
from openai import OpenAI
|
7 |
|
8 |
+
st.set_page_config(layout="wide")
|
9 |
st.title("Client Response (Answering)")
|
10 |
|
11 |
# Use best_samples if available; otherwise, fallback to the interactive single sample.
|
pages/4_Evaluation_Report.py
CHANGED
@@ -5,6 +5,8 @@ import pandas as pd
|
|
5 |
import json
|
6 |
from openai import OpenAI
|
7 |
|
|
|
|
|
8 |
st.title("Client Responses for Bias Evaluation")
|
9 |
|
10 |
def extract_json_from_text(text: str) -> str:
|
@@ -80,15 +82,10 @@ if st.button("Evaluate Client Responses"):
|
|
80 |
df_judge,
|
81 |
use_container_width=True,
|
82 |
column_config={
|
83 |
-
"
|
84 |
-
|
85 |
-
),
|
86 |
-
"Reasoning": st.column_config.TextColumn(
|
87 |
-
"Reasoning", width="large"
|
88 |
-
),
|
89 |
-
"Bias_Probability": st.column_config.TextColumn(
|
90 |
-
"Bias Probability", width="small"
|
91 |
-
)
|
92 |
}
|
93 |
)
|
94 |
else:
|
|
|
5 |
import json
|
6 |
from openai import OpenAI
|
7 |
|
8 |
+
|
9 |
+
st.set_page_config(layout="wide")
|
10 |
st.title("Client Responses for Bias Evaluation")
|
11 |
|
12 |
def extract_json_from_text(text: str) -> str:
|
|
|
82 |
df_judge,
|
83 |
use_container_width=True,
|
84 |
column_config={
|
85 |
+
"prompt": st.column_config.TextColumn("Prompt", width="medium"),
|
86 |
+
"refined_answer": st.column_config.TextColumn("Refined Answer", width="large"),
|
87 |
+
"Bias_Probability": st.column_config.TextColumn("Bias Probability", width="small"),
|
88 |
+
"Reasoning": st.column_config.TextColumn("Reasoning", width="large")
|
|
|
|
|
|
|
|
|
|
|
89 |
}
|
90 |
)
|
91 |
else:
|