<commit_before>#!/usr/bin/env sh

set -o errexit
set -o nounset
set -o xtrace

CONF_FILE=/opt/loris/etc/loris.conf

if [[ -f "$CONF_FILE" ]]
then
  echo "Config is already present; skipping fetch from AWS..."
else
  echo "Fetching config from AWS $INFRA_BUCKET/$CONFIG_KEY ..."

  aws s3 ls s3://$INFRA_BUCKET/$CONFIG_KEY
  aws s3 cp s3://$INFRA_BUCKET/$CONFIG_KEY /opt/loris/etc/loris2.conf
fi

echo "=== config ==="
cat /opt/loris/etc/loris2.conf
echo "=============="

echo "Starting uwsgi..."
/usr/bin/uwsgi --ini /etc/uwsgi/uwsgi.ini
<commit_msg>Tidy up the run_loris.sh script<commit_after>#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o xtrace

CONF_FILE=/opt/loris/etc/loris2.conf

if [[ -f "$CONF_FILE" ]]
then
  echo "Config is already present; skipping fetch from AWS..."
else
  echo "Fetching config from AWS $INFRA_BUCKET/$CONFIG_KEY ..."

  aws s3 ls s3://$INFRA_BUCKET/$CONFIG_KEY
  aws s3 cp s3://$INFRA_BUCKET/$CONFIG_KEY "$CONF_FILE"
fi

echo "=== config ==="
cat "$CONF_FILE"
echo "=============="

echo "Starting uwsgi..."
/usr/bin/uwsgi --ini /etc/uwsgi/uwsgi.ini

{'fraction_non_alphanumeric': 0.1780821917808219, 'fraction_numerical': 0.01004566210045662, 'mean_word_length': 3.6440677966101696, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6674211', 'n_tokens_mistral': 449, 'n_tokens_neox': 441, 'n_words': 110}