From f38f4ca8013baeb56ff05acea4eeddcc2664ece7 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Sun, 16 Apr 2023 14:27:31 -0700 Subject: [PATCH] Add profiler --- profiler.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 profiler.py diff --git a/profiler.py b/profiler.py new file mode 100644 index 0000000..b581951 --- /dev/null +++ b/profiler.py @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +import cProfile +import gptc +import json +import sys + +max_ngram_length = 10 + +with open("models/raw.json") as f: + raw_model = json.load(f) + +with open("models/benchmark_text.txt") as f: + text = f.read() + +cProfile.run("gptc.compile(raw_model, max_ngram_length)")