File size: 850 Bytes
90a03a3
0217809
d649c17
 
90a03a3
d649c17
 
 
 
90a03a3
d649c17
 
 
 
 
 
 
 
 
 
 
 
 
 
90a03a3
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
import gradio as gr
import subprocess
import os
import sys

# Add the path to the "src" directory of detect-pretrain-code-contamination to the sys.path
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "detect-pretrain-code-contamination"))
src_dir = os.path.join(project_root, "src")
sys.path.insert(0, src_dir)

import run as evaluator  # Import the run module

def evaluate(model):
    return evaluator.main(
                target_model="roneneldan/TinyStories-1M",
                ref_model="roneneldan/TinyStories-Instruct-1M",
                output_dir="out",
                data="truthful_qa",
                length=64,
                key_name="input",
                ratio_gen=0.4
            )  # Call the run_main function directly

iface = gr.Interface(fn=evaluate, inputs="text", outputs="text")
iface.launch()