Skip to content

Commit

Permalink
Batch evaluate
Browse files Browse the repository at this point in the history
  • Loading branch information
knc6 committed Nov 26, 2024
1 parent 8e7768f commit e26fb72
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions atomgpt/inverse_models/inverse_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def batch_evaluate(
def run_atomgpt_inverse(config_file="config.json"):
figlet = get_figlet()
print(figlet)
t1 = time.time()
config = loadjson(config_file)
config = TrainingPropConfig(**config)
pprint.pprint(config.dict())
Expand Down Expand Up @@ -418,32 +419,32 @@ def run_atomgpt_inverse(config_file="config.json"):
load_in_4bit=config.load_in_4bit,
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
batch_evaluate(
prompts=[i["input"] for i in m_test],
model=model,
tokenizer=tokenizer,
csv_out=config.csv_out,
config=config,
)
t1 = time.time()
batch_evaluate(
test_set=m_test,
model=model,
tokenizer=tokenizer,
csv_out=config.csv_out,
config=config,
)
t2 = time.time()
t1a = time.time()
# batch_evaluate(
# prompts=[i["input"] for i in m_test],
# model=model,
# tokenizer=tokenizer,
# csv_out=config.csv_out,
# config=config,
# )
# t1 = time.time()
# batch_evaluate(
# test_set=m_test,
# model=model,
# tokenizer=tokenizer,
# csv_out=config.csv_out,
# config=config,
# )
# t2 = time.time()
# t1a = time.time()
evaluate(
test_set=m_test,
model=model,
tokenizer=tokenizer,
csv_out=config.csv_out,
config=config,
)
t2a = time.time()
print(t2 - t1, t2a - t1a)
t2 = time.time()
print("Time taken:", t2 - t1)


if __name__ == "__main__":
Expand Down

0 comments on commit e26fb72

Please sign in to comment.