<commit_before><template>
  <form ref="form" @submit="uploadProtocol" action="http://127.0.0.1:5000/upload" method="POST" enctype="multipart/form-data" class='upload'>
    <div class="fileUpload">
      <span>Click or Drag to Upload </span>
      <input ref="input" @change="fileChange" type="file" name="file" class="upload" />
    </div>
  </form>
</template>

<script>
  export default {
    name: 'Upload',
    methods: {
      fileChange(e) {
        let files = e.target.files || e.dataTransfer.files
        this.uploadProtocol()
      },
      uploadProtocol() {
        let formData = new FormData();
        formData.append("file", this.$refs.form.file.files[0])
        this.$store.dispatch("uploadProtocol", formData)
        this.$router.push('/')
        return false
      }
    }
  }
</script><commit_msg>on successful upload, advance to first calibration screen automatically<commit_after><template>
  <form ref="form" @submit="uploadProtocol" action="http://127.0.0.1:5000/upload" method="POST" enctype="multipart/form-data" class='upload'>
    <div class="fileUpload">
      <span>Click or Drag to Upload </span>
      <input ref="input" @change="fileChange" type="file" name="file" class="upload" />
    </div>
  </form>
</template>

<script>
  export default {
    name: 'Upload',
    computed: {
      next() {
        return this.$store.state.tasks[0].placeables[0].href
      }
    },
    methods: {
      fileChange(e) {
        let files = e.target.files || e.dataTransfer.files
        this.uploadProtocol()
      },
      uploadProtocol() {
        let formData = new FormData();
        formData.append("file", this.$refs.form.file.files[0])
        this.$store.dispatch("uploadProtocol", formData)
        this.$router.push(this.next)
        return false
      }
    }
  }
</script>
{'fraction_non_alphanumeric': 0.16381687810259238, 'fraction_numerical': 0.013237727523441808, 'mean_word_length': 2.843220338983051, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5921611', 'n_tokens_mistral': 574, 'n_tokens_neox': 559, 'n_words': 111}