| Both sides previous revision Previous revision Next revision | Previous revision |
| dcc:itsol:whisper:running [2025/10/30 10:16] – Added text (incomplete) giulio | dcc:itsol:whisper:running [2025/10/30 13:56] (current) – adjusted index numbering giulio |
|---|
| {{indexmenu_n>3}} | {{indexmenu_n>2}} |
| ===== Running Whisper ===== | ===== Running Whisper ===== |
| |
| To run Whisper on HPC, you need to load an environment into your HPC session and build a script to specify what you want the software to do. The HPC Team has built an interface in their portal to make this task clear and easy for you. For this reason, we will describe how to use the interface in this part of the guide. Should you want to modify the script and the instructions to Whisper beyond what the interface allows you to do, then you are of course free to write your own script or contact [[dcc@rug.nl|dcc@rug.nl]] with your question. | To run Whisper on HPC, you need to load an environment into your HPC session and build a script to specify what you want the software to do. The HPC Team has built an interface in their portal to make this task clear and easy for you. For this reason, we will describe how to use the interface in this part of the guide. Should you want to modify the script and the instructions to Whisper beyond what the interface allows you to do, then you are, of course, free to write your own script or contact [[dcc@rug.nl|dcc@rug.nl]] with your question. |
| |
| To access the interface, log into the HPC portal and scroll down until you see the ''Jobs Wizard'' button shown in the screenshot. Click it to open a new window. | To access the interface, log into the HPC portal and scroll down until you see the ''Jobs Wizard'' button shown in the screenshot. Click it to open a new window. |
| {{ :dcc:itsol:whisper:hb_portal_5.png?direct&900 | }} | {{ :dcc:itsol:whisper:hb_portal_5.png?direct&900 | }} |
| |
| In the new window, select the wizard for Whisper. **Note**: As of the writing of this guide, there were only two apps available on this part of the portal. You might see more than two, if new ones have been added by the HPC team. | In the new window, select the wizard for Whisper. **Note**: As of the writing of this guide, there were only two apps available on this part of the portal. You might see more than two if the HPC team has added new ones in the meantime. |
| |
| {{ :dcc:itsol:whisper:hb_portal_6.png?direct&900 | }} | {{ :dcc:itsol:whisper:hb_portal_6.png?direct&900 | }} |
| |
| The first part of the interface asks you to specify where you want to save the script you are generating, what the script should be called, and what name to assign to the job when it runs. If you have followed this guide until this point, you can leave this part unchanged and move on to the next screenshot. If you have not followed the previous part of this guide, then the one requirement you need to fulfil for this part to work, is that the location where you want to save the script exists. To ensure this, select ''Select Path'', then follow the instructions until you find the folder you want to use. Finally, you can leave the script content hidden, as it is irrelevant if you use the interface. | The first part of the interface prompts you to specify where you want to save the generated script, what name you want to assign to the script, and what name to assign to the job when it runs. If you have followed this guide until this point, you can leave this part unchanged and move on to the next screenshot. If you have not followed the previous part of this guide, then the one requirement you need to fulfil for this part to work is that the location where you want to save the script exists. To ensure this, select ''Select Path'', then follow the instructions until you find the folder you want to use. Finally, you can leave the script content hidden, as it is irrelevant if you use the interface. |
| |
| {{ :dcc:itsol:whisper:hb_portal_7.png?direct&900 | }} | {{ :dcc:itsol:whisper:hb_portal_7.png?direct&900 | }} |
| |
| The second part of the interface is where you will select the instructions you wish to pass on to Whisper. Here is the explanation of the entry fields as they are numbered: | The second part of the interface is where you will select the instructions you wish to pass on to Whisper. Here is the explanation of the entry fields as they are numbered in the screenshot below: |
| - **GPU type**: | - **GPU type**: This drop-down menu selects the physical resource used to run your job on the cluster. The abbreviation GPU stands for Graphical Processing Unit, and you can keep the selected default as your input (V100). |
| - **Maximum hours/minutes**: | - **Maximum hours/minutes**: This entry determines the maximum amount of time your job will run on the cluster. We advise always requesting the maximum of 7 hours and 59 minutes (a normal workday), as it will ensure that your job will finish before the maximum time allocated is reached. We put a limit on the amount of time your job can take in order to avoid occupying resources for a long time in the cluster. As an indication, previous tests on our end have shown that ~8 hours of runtime equate to about 15-20 hours of audio. If you have more than 20 hours of audio to transcribe, we suggest that you split the audio files into two groups and run subsequent jobs on them. |
| - **Task**: | - **Task**: In this entry, you can select if you wish to transcribe text or translate it. Please keep in mind that Whisper can only translate X language to English. |
| - **Language**: | - **Language**: This entry lets you decide if Whisper is going to auto-detect the language spoken in the audio or if it is going to transcribe a language you select. If you leave the option blank, then Whisper is going to use the first 30 seconds of audio to determine the language. This can go wrong sometimes, depending on the audio quality and the accent of the speaker. If you select a language here, then Whisper is going to transcribe the audio in that language. This can be problematic if the audio contains multiple languages. |
| - **Show advanced option**: | - **Show advanced option**: Checking this box will allow you to input a prompt for Whisper to use as a guideline in the transcription. See the description of the next screenshot for more details. |
| - **Folder for input files**: | - **Folder for input files**: This entry selects the folder containing the audio that Whisper is going to transcribe or translate. If you followed this guide from the beginning, you can leave the default option selected. Please keep in mind that you cannot select which audio to transcribe. All audio files contained in this folder will be processed by Whisper. Make sure to clear out your input folder before starting a new job; otherwise, you will transcribe old data as well. **Note**: You have a maximum time to do the transcription; keeping old data in this folder will eventually make the job last too long to complete. |
| - **Folder for output files**: | - **Folder for output files**: This entry selects the folder where Whisper is going to save the transcripts of your audio. If you followed this guide from the beginning, you can leave the default option selected. Once your job is complete, you can retrieve the transcripts from here. To see what formats Whisper outputs, please go to the next page of this guide. |
| |
| {{ :dcc:itsol:whisper:hb_portal_8a.png?direct&900 | }} | {{ :dcc:itsol:whisper:hb_portal_8a.png?direct&900 | }} |
| When you are done setting the instructions, press ''Submit'' to start the transcription job. | When you are done setting the instructions, press ''Submit'' to start the transcription job. |
| |
| For those users that need the transcription to be done following a certain style, here is the option to add a prompt to the Whisper script. Please note that it might be necessary to try out a few prompts before the transcription works the way you want it to. We advise to choose a relatively short audio to experiment on, before launching the main job. | For those users who need the transcription to be done following a certain style, here is the option to add a prompt to the Whisper script. Please note that it might be necessary to try out a few prompts before the transcription works the way you want it to. We advise choosing a relatively short audio to experiment with before launching the main job. |
| |
| {{ :dcc:itsol:whisper:hb_portal_8b.png?direct&900 | }} | {{ :dcc:itsol:whisper:hb_portal_8b.png?direct&900 | }} |
| |
| Once you are done creating the script and you pressed ''Submit'', your job will have been added to the HPC queue. What this means is that your job will start running as soon as the requested resources are available in the cluster. This can take some time to happen. We advise to verify that the script is in the queue by selecting ''History'', as shown in the screenshot. This will direct you to a new window. | Once you are done creating the script and you press ''Submit'', your job will have been added to the HPC queue. What this means is that your job will start running as soon as the requested resources are available in the cluster. This can take some time to happen. We advise verifying that the script is in the queue by selecting ''History'', as shown in the screenshot. This will direct you to a new window. |
| |
| {{ :dcc:itsol:whisper:hb_portal_9.png?direct&900 | }} | {{ :dcc:itsol:whisper:hb_portal_9.png?direct&900 | }} |
| |
| In this new window, you will see the details of your job, such as the JobID or the location of the script. What you care about at this stage is the status, as highlighted in the screenshot. There are three statuses you will most likely see: | In this new window, you will see the details of your job, such as the JobID or the location of the script. What you care about at this stage is the status, as highlighted in the screenshot. There are three statuses you will most likely see: |
| * Queued | * QUEUED: Your job is in the queue, but the resources needed are not yet available. |
| * Running | * RUNNING: Your job is running, but has not yet finished. |
| * Completed | * COMPLETED: Your job is finished, and you can retrieve your data. |
| |
| Once your job shows the status **COMPLETED**, then you can go back to the main HPC page, select your scratch folder as you have done at the beginning of this guide and download the files in the "output" folder. Please verify that the transcription looks acceptable at first glance before deleting your input data. Once this step is completed, please read the next part of this guide, as there are some data management requirements that you need to follow. | Once your job shows the status **COMPLETED**, then you can go back to the main HPC page, select your scratch folder as you have done at the beginning of this guide, and download the files in the "output" folder. Please verify that the transcription looks acceptable at first glance before deleting your input data. Once this step is completed, please read the next part of this guide, as there are some data management requirements that you need to follow. |
| |
| {{ :dcc:itsol:whisper:hb_portal_10.png?direct&900 | }} | {{ :dcc:itsol:whisper:hb_portal_10.png?direct&900 | }} |
| |
| ===== OLD CONTENT ===== | |
| |
| |
| Now that you have your general script ready, all you have to do to run it is to simply copy the command below into your terminal and press enter: | |
| |
| * <code> sbatch whisper_runall.sh </code> | |
| |
| The terminal will then confirm that your job has been received and assign it a ''jobID''. The three messages below will appear in your terminal. | |
| |
| <code> | |
| sbatch: Job sent to gpu partition | |
| sbatch: Request for one of the default GPU types added | |
| Submitted batch job <jobID> | |
| </code> | |
| |
| Please keep the ''jobID'' handy, as that is the quickest way to check how the job is going and if it ran successfully. The figure below shows what the terminal will look like upon successfully launching the script. {{ :dcc:itsol:whisper:run_1a.png?direct&600 | }} | |
| |
| Once the job is complete, you will find the transcribed audio in the output folder you specified in the batch script. | |
| |
| **Note**: The script shown here will **run Whisper on all audio files present in the folder ''whisper_audio''**. Please make sure to **only have the files that you wish to transcribe** in that folder. | |
| |
| To check if the HPC has finished your job, type the following as shown in the figure below: | |
| |
| * <code> jobinfo <jobID> </code> | |
| {{ :dcc:itsol:whisper:run_2a.png?direct&600 | }} | |
| |
| This will show a list of all the information related to the job. What you want to check is if the "State" parameter says "COMPLETED", and if the "Reserved walltime" is greater than the "Used walltime". If both these values are as described here, it means that the HPC has finished processing your audio and that the job ran correctly. {{ :dcc:itsol:whisper:run_3a.png?direct&600 | }} | |
| |
| If you have launched multiple jobs (which we do not recommend), or if you simply want to see if the job is done without displaying the details of it, type in the following: | |
| |
| * <code> squeue -u (your_pnumber) </code> | |
| |
| This command **displays all the active jobs** linked to your account. In the list that will appear, look for the ''jobID'' that you recorded and, under the column ''ST'', read the letter written there. ''PD'' means the job is waiting for resources to be available, ''R'' means that the job is running, ''CG'' means that the job is completing. If your job does not appear in this list, it means that the HPC cluster has finished processing your audio. | |
| |
| [[dcc:itsol:whisper:datamanage| → Move to the next step]] | [[dcc:itsol:whisper:datamanage| → Move to the next step]] |
| |