Changeset 35253 for main/trunk/model-interfaces-dev/atea
- Timestamp:
- 2021-08-05T12:59:41+12:00 (3 years ago)
- Location:
- main/trunk/model-interfaces-dev/atea
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/js/asr/TranscribeService.js
r35252 r35253 33 33 { 34 34 /** @type {String} The URL to which query POST requests should be made */ 35 this.queryUrl = "/gs3-koreromaori/transcribe"; 35 this.queryUrl = "/gs3-koreromaori/transcribe/test"; 36 this.MAX_BATCH_COUNT = 3; 37 this.MAX_BATCH_SIZE = 5242880; // 5 MiB 36 38 } 37 39 … … 40 42 * Data is chunked according to which ever occurs first: 41 43 * A maximum of three files per request, or; 42 * A maximum of 5 MiB per request.44 * A maximum of 5 MiB before chunking. 43 45 * 44 46 * @param {FileList} files The files to upload 45 47 * @returns {AsyncGenerator<TranscriptionModel[]>} The transcribed audio files. 46 48 */ 47 async* chunkTranscribeFiles(files)49 async* batchTranscribeFiles(files) 48 50 { 49 51 let filesToSubmit = []; … … 51 53 let byteCounter = 0; 52 54 53 for (let file of files) { 54 if (fileCounter == 3 || byteCounter > 5242880) // 5 MiB 55 for (let file of files) 56 { 57 if (fileCounter == this.MAX_BATCH_COUNT || byteCounter > this.MAX_BATCH_SIZE) // 5 MiB 55 58 { 56 59 yield await this.transcribeFiles(filesToSubmit); -
main/trunk/model-interfaces-dev/atea/js/asr/asr-controller.js
r35252 r35253 50 50 const transcribeService = new TranscribeService(); 51 51 52 $(FILE_UPLOAD_INPUT_NAME).prop("disabled", true); 52 53 $(FILE_UPLOAD_PROGRESS_CONTAINER_NAME).removeClass("asr-hidden"); 53 54 … … 66 67 try 67 68 { 68 for await (const transcriptionBundle of transcribeService. chunkTranscribeFiles(files))69 for await (const transcriptionBundle of transcribeService.batchTranscribeFiles(files)) 69 70 { 70 71 for (const t of transcriptionBundle) … … 86 87 87 88 $(FILE_UPLOAD_PROGRESS_CONTAINER_NAME).addClass("asr-hidden"); 89 $(FILE_UPLOAD_INPUT_NAME).prop("disabled", false); 88 90 } 89 91 -
main/trunk/model-interfaces-dev/atea/transform/pages/asr.xsl
r35252 r35253 38 38 <!-- Template for processing audio file uploads --> 39 39 <xsl:template name="audio-upload"> 40 <link rel="stylesheet" href="interfaces/{$interface_name}/style/asr.css" type="text/css" />40 <link href="interfaces/{$interface_name}/style/asr.css" rel="stylesheet" type="text/css" /> 41 41 42 42 <div>
Note:
See TracChangeset
for help on using the changeset viewer.