<commit_before>#!/usr/bin/env python
#
# Syntax: ./run_job <session-id>
#
# It should be run with the current working directory set properly
#
import sys, json
from sci.session import Session
from sci.bootstrap import Bootstrap

data = json.loads(sys.stdin.read())

session_id = sys.argv[1]
session = Session.load(session_id)

run_info = data['run_info']
Bootstrap.run(session, data['build_id'], data['job_server'],
              run_info['step_fun'], args = run_info['args'],
              kwargs = run_info['kwargs'], env = run_info['env'])
<commit_msg>Support when run_info is not specified<commit_after>#!/usr/bin/env python
#
# Syntax: ./run_job <session-id>
#
# It should be run with the current working directory set properly
#
import sys, json
from sci.session import Session
from sci.bootstrap import Bootstrap

data = json.loads(sys.stdin.read())

session_id = sys.argv[1]
session = Session.load(session_id)

run_info = data['run_info'] or {}

Bootstrap.run(session, data['build_id'], data['job_server'],
              run_info.get('step_fun'),
              args = run_info.get('args', []),
              kwargs = run_info.get('kwargs', {}),
              env = run_info.get('env'))

{'fraction_non_alphanumeric': 0.1423785594639866, 'fraction_numerical': 0.0016750418760469012, 'mean_word_length': 3.838056680161943, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2034037', 'n_tokens_mistral': 385, 'n_tokens_neox': 378, 'n_words': 96}