Spaces:
Runtime error
Runtime error
File size: 609 Bytes
90a03a3 0217809 90a03a3 0217809 eb5eda7 0217809 90a03a3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import gradio as gr
import subprocess
dataset = "truthful_qa"
def greet(model):
global dataset
command = f"python detect-pretrain-code-contamination/src/run.py --target_model {model} --ref_model roneneldan/TinyStories-Instruct-1M --data {dataset} --output_dir detect-pretrain-code-contamination/out/{dataset} --ratio_gen 0.4"
result = subprocess.run(command, shell=True,capture_output=True, text=True)
if result.returncode == 0:
return result.stdout
else:
return f"Error: {result.stderr}"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()
|