Update app.py
Browse files
app.py
CHANGED
@@ -11,9 +11,9 @@ HF_TOKEN = os.getenv('HF_TOKEN')
|
|
11 |
login(token=HF_TOKEN)
|
12 |
|
13 |
|
14 |
-
dataset_1 = load_dataset("
|
15 |
-
dataset_2 = load_dataset("
|
16 |
-
dataset_3 = load_dataset("
|
17 |
|
18 |
df_log = pd.DataFrame(columns=["instruction", "selected_model", "pair", "submission_time"])
|
19 |
|
@@ -46,7 +46,7 @@ def format_response_html(response):
|
|
46 |
|
47 |
def submit_choice(selected_response, instruction, label_1, label_2, pair_name):
|
48 |
try:
|
49 |
-
df_log = pd.DataFrame(load_dataset("
|
50 |
except:
|
51 |
df_log = pd.DataFrame(columns=["instruction", "selected_model",
|
52 |
"pair", "submission_time"])
|
@@ -64,7 +64,7 @@ def submit_choice(selected_response, instruction, label_1, label_2, pair_name):
|
|
64 |
df_log = pd.concat([df_log, new_entry], ignore_index=True)
|
65 |
df_log.to_csv("annotations_log.csv", index=False)
|
66 |
log = Dataset.from_pandas(df_log)
|
67 |
-
log.push_to_hub("
|
68 |
|
69 |
new_instruction, new_response_1, new_response_2, new_label_1, new_label_2, new_pair_name = get_random_row()
|
70 |
|
|
|
11 |
login(token=HF_TOKEN)
|
12 |
|
13 |
|
14 |
+
dataset_1 = load_dataset("HumanLLMs/LlamaPair")["train"]
|
15 |
+
dataset_2 = load_dataset("HumanLLMs/QwenPair")["train"]
|
16 |
+
dataset_3 = load_dataset("HumanLLMs/MistralPair")["train"]
|
17 |
|
18 |
df_log = pd.DataFrame(columns=["instruction", "selected_model", "pair", "submission_time"])
|
19 |
|
|
|
46 |
|
47 |
def submit_choice(selected_response, instruction, label_1, label_2, pair_name):
|
48 |
try:
|
49 |
+
df_log = pd.DataFrame(load_dataset("HumanLLMs/log")["train"])
|
50 |
except:
|
51 |
df_log = pd.DataFrame(columns=["instruction", "selected_model",
|
52 |
"pair", "submission_time"])
|
|
|
64 |
df_log = pd.concat([df_log, new_entry], ignore_index=True)
|
65 |
df_log.to_csv("annotations_log.csv", index=False)
|
66 |
log = Dataset.from_pandas(df_log)
|
67 |
+
log.push_to_hub("HumanLLMs/log")
|
68 |
|
69 |
new_instruction, new_response_1, new_response_2, new_label_1, new_label_2, new_pair_name = get_random_row()
|
70 |
|