Yeyito commited on
Commit
0217809
1 Parent(s): eb5eda7

First Test

Browse files
Files changed (3) hide show
  1. app.py +10 -1
  2. detect-pretrain-code-contamination +1 -0
  3. requirements.txt +9 -0
app.py CHANGED
@@ -1,7 +1,16 @@
1
  import gradio as gr
 
2
 
 
3
  def greet(model):
4
- return "This model has a similarity score of: meh!"
 
 
 
 
 
 
 
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
1
  import gradio as gr
2
+ import subprocess
3
 
4
+ dataset = "truthful_qa"
5
  def greet(model):
6
+ global dataset
7
+ 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"
8
+ result = subprocess.run(command, shell=True,capture_output=True, text=True)
9
+
10
+ if result.returncode == 0:
11
+ return result.stdout
12
+ else:
13
+ return f"Error: {result.stderr}"
14
 
15
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
16
  iface.launch()
detect-pretrain-code-contamination ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 616114e2334dc8dc8b7b538f6dbcc639cc42cb2c
requirements.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ numpy
2
+ openai
3
+ torch
4
+ transformers
5
+ datasets
6
+ ipdb
7
+ matplotlib
8
+ scikit-learn
9
+ accelerate