File size: 1,241 Bytes
1c79925
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import streamlit as st  
from parse import retrieve

  
def main():  
    st.title("Streamlit App")  
  
    model_name = st.selectbox(  
        "Select Model",  
        options=["T5", "Vicuna", "UL2", "ChatGPT"],  
        index=0,  
    )  
  
    dataset_name = st.selectbox(  
        "Select Dataset",  
        options=[  
            "SST-2", "CoLA", "QQP", "MRPC", "MNLI", "QNLI",  
            "RTE", "WNLI", "MMLU", "SQuAD V2", "IWSLT 2017", "UN Multi", "Math"  
        ],  
        index=0,  
    )

    attack_name = st.selectbox(
        "Select Attack",
        options=[
            "BertAttack", "CheckList", "DeepWordBug", "StressTest", "TextFooler", "TextBugger", "Semantic"
        ],
        index=0,
    )

    prompt_type = st.selectbox(  
        "Select Prompt Type",  
        options=["zeroshot-task", "zeroshot-role", "fewshot-task", "fewshot-role"],  
        index=0,  
    )  
  
    st.write(f"Model: {model_name}")  
    st.write(f"Dataset: {dataset_name}")  
    st.write(f"Prompt Type: {prompt_type}")  
  
    if st.button("Retrieve"):  
        output = retrieve(model_name, dataset_name, attack_name, prompt_type)  
        st.write(f"Output: {output}")  
  
if __name__ == "__main__":  
    main()