Skip to content

Commit

Permalink
Merge pull request #25 from TianyiQ/main
Browse files Browse the repository at this point in the history
fix(benchmarking): model initialization
  • Loading branch information
TianyiQ authored Dec 7, 2024
2 parents 1aefe97 + d463649 commit c33bfc0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions benchmark/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def reset(self, **kwargs) -> None:
self.model_list = []
for i in range(22):
try:
model_name = "%db-C%03d-instruct" % (self.model_size, i)
model_name = "%dB-C%03d-instruct" % (self.model_size, i)
self.model_list.append(
Model(
model_name=model_name,
Expand Down Expand Up @@ -314,7 +314,9 @@ def reset(self, **kwargs) -> None:
)
for i in range(22):
try:
kwargs["model_name"] = "%db-C%03d-instruct" % (self.model_size, i)
kwargs["model_name"] = "%dB-C%03d-instruct" % (self.model_size, i)
self.current_model = Model(kwargs["model_name"])
break
except:
pass

Expand Down
2 changes: 1 addition & 1 deletion src/abstractions/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ def __evaluate_fast(self, logprobs = True) -> np.ndarray:
) as f:
json.dump(raw_stats, f)
print("raw results saved")
vec = calculate_model(experiment_directory, self.model_name, logprob = logprob)
vec = calculate_model(experiment_directory, self.model_name, logprobs)
return vec

def __evaluate_slow_moralchoice(self) -> np.ndarray:
Expand Down
3 changes: 2 additions & 1 deletion src/evaluation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ def _collect(output_data):
output[s_id][q_type][-1] += np.exp(x)
else:
invalid += 1
print(invalid)

print(f"{invalid} out of {len(output_data)} entries are invalid")
return output


Expand Down

0 comments on commit c33bfc0

Please sign in to comment.