File size: 1,715 Bytes
b9a5258
eb22f3c
b9a5258
 
ce2e5dd
 
eb22f3c
 
 
 
b9a5258
ce2e5dd
 
 
 
 
 
 
 
 
 
 
 
 
 
b9a5258
 
eb22f3c
fdf02d9
b9a5258
 
eb22f3c
1fc09bd
 
eb22f3c
 
fdf02d9
eb22f3c
b9a5258
 
ce2e5dd
b9a5258
 
 
eb22f3c
 
 
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
import io
from contextlib import redirect_stdout
from dataloader import main as dtLoader
from evalue import main2 as run_eval


def main():
    st.title("RGB Evaluation Tool")

    st.subheader('Load Sample data')

    sampleset = st.text_input("Sample data (e.g., en, en_int):", "en")
    if st.button("Load Samples"):
        st.write("loading samples...")
        dataargs = ["--dataset", sampleset]
        print('Samples loading.....')
        ff = io.StringIO()
        with redirect_stdout(ff):
            dtLoader(dataargs)
            out1 = ff.getvalue()
            st.text_area("Execution Output", out1, height=300, disabled=True)
            st.success("Samples loading. completed!")
    
    st.subheader('Evaluation')

    dataset = st.text_input("Dataset name (e.g., en, en_int):", "en")
    model = st.text_input("Model name:", "groq")
    plm = st.text_input("Plm:", "moonshotai/kimi-k2-instruct")
    temp = st.slider("Temp", 0.0, 1.0, 0.2)
    noise = st.slider("Noise Rate", 0.0, 1.0, 0.6)
    passsage_num = st.slider("Passage Num", 0, 10, 5)
    correct_rate = st.slider("Correct Rate", 0.0, 1.0, 1.0)
    
    if st.button("Run Evaluation"):
        args = ["--dataset", dataset, "--modelname", model, "--plm", plm, "--temp", str(temp), "--noise_rate", str(noise), "--passage_num", str(passsage_num), "--correct_rate", str(correct_rate)]
        st.write("Running evaluation...")
        f = io.StringIO()
        with redirect_stdout(f):
            run_eval(args)
            output = f.getvalue()
            st.text_area("Execution Output", output, height=300, disabled=True)
            st.success("Evaluation completed!")

if __name__ == "__main__":
    main()