Add profiler

This commit is contained in:
Samuel Sloniker 2023-04-16 14:27:31 -07:00
parent 56550ca457
commit f38f4ca801
Signed by: kj7rrv
GPG Key ID: 1BB4029E66285A62

16
profiler.py Normal file
View File

@ -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)")