Skip to content

Commit

Permalink
debug entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nandajavarma committed Aug 2, 2024
1 parent 544a501 commit 0323547
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,24 +237,6 @@ def serve_logos(path):
dir_path = dirname(realpath(__file__))
pod_dir = getenv("PODS_DIR", join(dir_path, 'pods'))

LANGUAGE_CODES = read_language_codes()
models = dict()
for LANG in app.config['LANGS']:
models[LANG] = {}
spm_vocab_file = f'{LANG}/{LANG}wiki.16k.vocab'
ft_file = f'{LANG}/{LANG}wiki.16k.cos'
spm_vocab_path = join(dir_path, 'api/models/', spm_vocab_file)
ft_path = join(dir_path, 'api/models/', ft_file)
vocab, inverted_vocab, logprobs = read_vocab(spm_vocab_path)
vectorizer = CountVectorizer(vocabulary=vocab, lowercase=True, token_pattern='[^ ]+')
ftcos = read_cosines(ft_path)
models[LANG]['vocab'] = vocab
models[LANG]['inverted_vocab'] = inverted_vocab
models[LANG]['logprobs'] = logprobs
models[LANG]['vectorizer'] = vectorizer
models[LANG]['nns'] = ftcos
models[LANG]['stopwords'] = read_stopwords(LANGUAGE_CODES[LANG].lower())

if not app.config['LIVE_MATRIX']:
from app.search.score_pages import mk_vec_matrix
for LANG in app.config['LANGS']:
Expand Down

0 comments on commit 0323547

Please sign in to comment.