Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,474 changes: 0 additions & 7,474 deletions data/gsm/mistral/mistral_gsm_response.csv

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions script/gsm/flan_gsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from jsonformer import Jsonformer

from config import access_token, DIR_PATH
from utils import get_questions_and_answer_from_dataset
from utils import get_noisy_questions_and_answer_from_dataset

tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-xl")
model = T5ForConditionalGeneration.from_pretrained(
Expand All @@ -26,8 +26,8 @@
},
}

csv_file = f"{DIR_PATH}/data/gsm/train_preprocessed.csv"
questions, ground_truths = get_questions_and_answer_from_dataset(csv_file)
csv_file = f"{DIR_PATH}/data/noisy_datasets/gsm8k_noisy_punct_10.csv"
questions, ground_truths = get_noisy_questions_and_answer_from_dataset(csv_file)


output_file = (
Expand Down
6 changes: 3 additions & 3 deletions script/gsm/mistral_gsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from jsonformer import Jsonformer

from config import access_token, DIR_PATH
from utils import get_questions_and_answer_from_dataset
from utils import get_noisy_questions_and_answer_from_dataset

access_token = access_token
model_name = "mistralai/Mistral-7B-v0.1"
Expand Down Expand Up @@ -46,8 +46,8 @@
},
}

csv_file = f"{DIR_PATH}/data/gsm/train_preprocessed.csv"
questions, ground_truths = get_questions_and_answer_from_dataset(csv_file)
csv_file = f"{DIR_PATH}/data/noisy_datasets/gsm8k_noisy_punct_10.csv"
questions, ground_truths = get_noisy_questions_and_answer_from_dataset(csv_file)


output_file = (
Expand Down
6 changes: 3 additions & 3 deletions script/gsm/mistral_instruct_gsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from jsonformer import Jsonformer

from config import access_token, DIR_PATH
from utils import get_questions_and_answer_from_dataset
from utils import get_noisy_questions_and_answer_from_dataset


access_token = access_token
Expand Down Expand Up @@ -46,8 +46,8 @@
},
}

csv_file = f"{DIR_PATH}/data/gsm/train_preprocessed.csv"
questions, ground_truths = get_questions_and_answer_from_dataset(csv_file)
csv_file = f"{DIR_PATH}/data/noisy_datasets/gsm8k_noisy_punct_10.csv"
questions, ground_truths = get_noisy_questions_and_answer_from_dataset(csv_file)


output_file = f"{DIR_PATH}/data/gsm/mistral_instruct/mistral_instruct_gsm_response.csv"
Expand Down
6 changes: 3 additions & 3 deletions script/gsm/mistral_math_gsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from jsonformer import Jsonformer

from config import access_token, DIR_PATH
from utils import get_questions_and_answer_from_dataset
from utils import get_noisy_questions_and_answer_from_dataset


access_token = access_token
Expand Down Expand Up @@ -45,8 +45,8 @@
},
}

csv_file = f"{DIR_PATH}/data/gsm/train_preprocessed.csv"
questions, ground_truths = get_questions_and_answer_from_dataset(csv_file)
csv_file = f"{DIR_PATH}/data/noisy_datasets/gsm8k_noisy_punct_10.csv"
questions, ground_truths = get_noisy_questions_and_answer_from_dataset(csv_file)

#TODO: Change to relative path
output_file = f"{DIR_PATH}/data/gsm/mistral_math/mistral_math_gsm_response.csv"
Expand Down
9 changes: 9 additions & 0 deletions script/gsm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,12 @@ def safe_convert_llm_to_int(value):
)

print("Accuracy saved to accuracy.csv.")



def get_noisy_questions_and_answer_from_dataset(csv_file_path):
# Load the specific CSV file
data = pd.read_csv(csv_file_path)
questions = data["noisy_questions"].tolist()
groundTruths = data["numeric_answer"].tolist()
return questions,groundTruths