Spaces:
Runtime error
Runtime error
| 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() | |