Skip to content

Commit b38e902

Browse files
authored
Merge pull request #1686 from zachlasiuk/main
Template: Whisper demo finalization, added DevProgram signup modal to next steps page
2 parents fd44959 + ac4a717 commit b38e902

File tree

10 files changed

+190
-8
lines changed

10 files changed

+190
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ on:
2121
required: true
2222
HUGO_AUDIO_API:
2323
required: true
24+
HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID:
25+
required: true
26+
HUGO_DEV_PROG_SIGNIUP_FORM_ID:
27+
required: true
2428

2529
env:
2630
HUGO_VERSION: 0.130.0
@@ -69,6 +73,8 @@ jobs:
6973
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}
7074
HUGO_RAG_API: ${{ secrets.HUGO_RAG_API }}
7175
HUGO_AUDIO_API: ${{ secrets.HUGO_AUDIO_API }}
76+
HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }}
77+
HUGO_DEV_PROG_SIGNIUP_FORM_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }}
7278

7379
# Deploys website to AWS S3 and invalidate CloudFront Cache
7480
- name: Deploy to S3

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ jobs:
2424
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}
2525
HUGO_RAG_API: ${{ secrets.HUGO_RAG_API }}
2626
HUGO_AUDIO_API: ${{ secrets.HUGO_AUDIO_API }}
27+
HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }}
28+
HUGO_DEV_PROG_SIGNIUP_FORM_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }}

.github/workflows/production.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ jobs:
2424
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}
2525
HUGO_RAG_API: ${{ secrets.HUGO_RAG_API }}
2626
HUGO_AUDIO_API: ${{ secrets.HUGO_AUDIO_API }}
27+
HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }}
28+
HUGO_DEV_PROG_SIGNIUP_FORM_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ node_modules/
66
package-lock.json
77
.hugo_build.lock
88
.vscode
9+
.env
10+
startup.sh
911

1012
# macOS files
1113
*.DS_Store

content/learning-paths/servers-and-cloud-computing/whisper/_demo.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
---
22
title: Demo - Audio transcription on Arm
33
overview: |
4-
Insert helpful overview here.
4+
This Learning Path shows you how to use a c8g.8xlarge AWS Graviton4 instance powered by an Arm Neoverse CPU to build a simple Transcription-as-a-Service server.
55
6+
This architecture is suitable for businesses looking to deploy the latest Generative AI technologies with audio transcription capabilities using their existing CPU compute capacity and deployment pipelines. This demo provides speech recognition using the `whisper-large-v3-turbo model`, deployed using the Hugging Face Transformers framework.
7+
8+
Record audio from your browser to interact with the Whisper model and send it to be transcribed to see the performance for yourself. Note that no recorded audio is saved on our servers at any point.
9+
10+
After running the demo you can follow the Learning Path to build your own Generative AI service on Arm Neoverse.
611
712
813
demo_steps:
9-
- Record your voice (giving mic permissions to your browser).
10-
- Review and send to _________________insert technical thing here_____________.
11-
- Get transcription and view stats.
14+
- Record your voice (give microphone permissions to your browser).
15+
- Review and send the audio file to the sever for transcription.
16+
- Recieve transcribed output and view stats.
1217

1318

1419
title_chatbot_area: Whisper Voice Demo
@@ -21,7 +26,8 @@ terms_and_conditions: demo-terms-and-conditions.txt
2126

2227
### Specific details to this demo
2328
# ================================================================================
24-
stats_description: The 'total time' for a whisper voice-to-text process refers to the complete duration taken from the moment the audio input is received until the final text output is generated. This includes several related times such as the 'pre-processing time', which is the time taken to prepare the audio data for transcription, the 'transcription time', which is the actual time spent converting the audio to text, and the 'post-processing time', which involves refining and formatting the transcribed text. Each of these stages contributes to the overall 'total time' and can vary depending on factors such as audio quality, length of the audio, and the efficiency of the transcription algorithm.
29+
stats_description: |
30+
The 'total time' for a whisper voice-to-text process refers to the complete duration taken from the moment the audio input is received until the final text output is generated. This includes several related times such as the 'pre-processing time', which is the time taken to prepare the audio data for transcription, the 'transcription time', which is the actual time spent converting the audio to text, and the 'post-processing time', which involves refining and formatting the transcribed text. Each of these stages contributes to the overall 'total time' and can vary depending on factors such as audio quality, length of the audio, and the efficiency of the transcription algorithm.
2531
2632
### FIXED, DO NOT MODIFY
2733
# ================================================================================

content/learning-paths/servers-and-cloud-computing/whisper/demo-terms-and-conditions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TERMS OF SERVICE FOR USE OF CHATBOT DEMO
1+
TERMS OF SERVICE FOR USE OF WHISPER DEMO
22

33
PLEASE READ THESE TERMS OF SERVICE CAREFULLY.
44
BY USING THE SERVICE, YOU HEREBY ACKNOWLEDGE AND AGREE THAT YOU HAVE READ, FULLY UNDERSTAND, AND AGREE TO BE BOUND BY THESE TERMS OF SERVICE. IF YOU ARE ENTERING INTO THESE TERMS OF SERVICE ON BEHALF OF A COMPANY OR OTHER ENTITY, YOU REPRESENT THAT YOU HAVE THE AUTHORITY TO BIND SUCH COMPANY OR OTHER ENTITY TO THESE TERMS OF SERVICE.

themes/arm-design-system-hugo-theme/layouts/partials/demo-components/llm-voice-transcriber/demo-stats--llm-voice-transcriber.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ <h2>Stats</h2>
131131
<span id="total-time-metric" style="color: var(--arm-green); font-size: 72px;"></span>
132132
</div>
133133
<div class="c-row">
134-
<p style="color: var(--arm-green);">seconds to complete transcription.</p>
134+
<p style="color: var(--arm-green);">seconds to complete transcription of audio recorded at <span id="sample-rate-metric"></span>kHz.</p>
135135
</div>
136136
<br>
137137
<p>

themes/arm-design-system-hugo-theme/layouts/partials/demo-components/llm-voice-transcriber/javascript--llm-voice-transcriber.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
var connectionStatus = {
2121
isActive: false
2222
};
23-
23+
var sample_rate = 0;
2424

2525

2626

@@ -30,6 +30,8 @@
3030
document.getElementById('stats-initial').hidden = true;
3131
// Update time taken
3232
document.getElementById('total-time-metric').textContent = time_taken;
33+
34+
document.getElementById('sample-rate-metric').textContent = sample_rate;
3335
}
3436

3537

@@ -126,6 +128,15 @@
126128
mediaRecorder.start();
127129
isRecording = true;
128130

131+
// Create an AudioContext to get the sample rate
132+
const audioContext = new AudioContext();
133+
sample_rate = audioContext.sampleRate; // update global var
134+
sample_rate = 48000;
135+
sample_rate = (sample_rate / 1000).toFixed(1).replace(/\.0$/, '');
136+
137+
console.log('Recording audio at: ', sample_rate, 'kHz');
138+
139+
129140

130141
// Cap recording at set time
131142
audio_cap_timeout = setTimeout(() => {

themes/arm-design-system-hugo-theme/layouts/partials/learning-paths/next-steps.html

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,167 @@ <h4>Read related resources</h4>
242242

243243

244244
<div id="arm-dev-program-div" class="content-box">
245+
<!--
245246
<h4>Talk with Arm Experts</h4>
246247
<p>Join the Arm Developer Program to share ideas, ask questions, and explore solutions with the support of the developer community.</p>
248+
247249
<ads-cta-button id="join-dev-program" level="primary" sr-label="primary button" class="next-step-cta" name="DevProgram">Join now</ads-cta-button>
248250
<script>
249251
document.getElementById("join-dev-program").onclick = function () {
250252
window.open("https://www.arm.com/resources/developer-program?#register","_blank");
251253
};
252254
</script>
255+
-->
256+
257+
<h4>Join Developer Program</h4>
258+
<p>Join the Arm Developer Program to share ideas, ask questions, and explore solutions with the support of the developer community.</p>
259+
260+
<ads-modal id="modal-custom-trigger">
261+
<div slot="body">
262+
<div id="form-display">
263+
<h2 class="modal-title u-margin-right-1/2" style="margin-top: 0px; margin-bottom: 16px;">Join Arm Developer Program</h2>
264+
<div class="c-row" style="max-width: 650px;">
265+
<p>By signing up, you will receive member news and email updates on topics that interest you. You can manage your subscription preferences anytime.</p>
266+
</div>
267+
<div class="c-row lg:u-display-block u-hide u-margin-bottom-1 u-margin-right-1/2">
268+
<img src="/img/arm_dev_program_half.jpg" alt="Developer Program" style="width: 98%; max-width: 650px; display: block;">
269+
</div>
270+
<hr class="u-margin-right-1/2">
271+
<div id="marketo-form-container"></div>
272+
</div>
273+
<div id="form-completed" hidden>
274+
<h2 class="modal-title">Program Registration Success</h2>
275+
<p class="success-message">You're almost there! To complete your membership registration, please click 'confirm membership' in the email we have just sent you.</p>
276+
<p class="success-message">Please check your spam folder if you do not see any email in your inbox within 10 minutes.</p>
277+
</div>
278+
</div>
279+
<div slot="actions" class="u-flex u-flex-direction-column md:u-flex-direction-row u-gap-1" style="justify-content: flex-start;">
280+
<ads-cta-button id="devprog-cta-submit" level="primary" class="devprog-modal-button" type="submit" sr-label="submit">Submit</ads-cta-button>
281+
<ads-cta-button level="secondary" class="devprog-cta-close devprog-modal-button" type="button" sr-label="close">Close</ads-cta-button>
282+
</div>
283+
<div slot="trigger">
284+
<ads-cta-button id="dev-program-show-form" level="primary" class="next-step-cta" name="DevProgram">Join now</ads-cta-button>
285+
</div>
286+
</ads-modal>
287+
<script>
288+
(() => {
289+
const modal = document.getElementById('modal-custom-trigger');
290+
291+
// Close model button
292+
document.querySelectorAll('.devprog-cta-close').forEach((button) => {
293+
button.addEventListener('click', function() {
294+
modal.close();
295+
});
296+
});
297+
298+
299+
300+
301+
// SECTION 5: Marketo Developer Program Form Embed
302+
const formScript = document.createElement('script');
303+
formScript.src = '//engaged.arm.com/js/forms2/js/forms2.min.js';
304+
formScript.onload = function() {
305+
MktoForms2.loadForm(
306+
'//engaged.arm.com',
307+
'{{getenv "HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID"}}',
308+
{{getenv "HUGO_DEV_PROG_SIGNIUP_FORM_ID"}},
309+
310+
function(form) {
311+
const formContainer = document.getElementById('marketo-form-container');
312+
formContainer.appendChild(form.getFormElem()[0]);
313+
formContainer.querySelector('form').style.display = 'block';
314+
315+
// Handle successful form submission
316+
form.onSuccess(function() {
317+
// Hide 'form-display' and devprog submit button and show 'form-completed'
318+
document.getElementById('form-completed').hidden = false;
319+
document.getElementById('form-display').hidden = true;
320+
document.getElementById('devprog-cta-submit').style.display = 'none';
321+
return false;
322+
});
323+
324+
// Form submit handler
325+
const registerButton = modal.querySelector('#devprog-cta-submit');
326+
registerButton.addEventListener('click', () => {
327+
form.submit();
328+
});
329+
330+
// SECTION 6: Apply Form Styles - full css in css reference file
331+
const formStyles = document.createElement('style');
332+
formStyles.textContent = `
333+
/* Marketo Form Style Overrides */
334+
335+
/* Hide unnecessary Marketo elements */
336+
.mktoPlaceholder,
337+
.mktoPlaceholderHtmlText_2024-07-02717_8762,
338+
.mktoPlaceholderdataTransferConsent,
339+
div[class*="mktoPlaceholder"],
340+
.mktoFormRow:has(input[type="hidden"]:only-child),
341+
.mktoFormRow:has(.mktoFieldDescriptor:only-child input[type="hidden"]),
342+
.mktoFormRow:has(.mktoPlaceholder:only-child),
343+
.mktoFormRow:not(:has(select, input[type="text"], input[type="email"])),
344+
.mktoFormRow:empty,
345+
.mktoButtonRow {
346+
display: none !important;
347+
height: 0 !important;
348+
margin: 0 !important;
349+
padding: 0 !important;
350+
min-height: 0 !important;
351+
opacity: 0 !important;
352+
position: absolute !important;
353+
pointer-events: none !important;
354+
}
355+
356+
/* Base form layout */
357+
.mktoForm {
358+
width: 100% !important;
359+
font-family: Lato, Helvetica, Arial, sans-serif !important;
360+
color: #333e48 !important;
361+
margin-bottom: 0 !important;
362+
}
363+
364+
/* Form field styling */
365+
.mktoForm input[type="text"],
366+
.mktoForm input[type="email"],
367+
.mktoForm select {
368+
width: 100% !important;
369+
height: 40px !important;
370+
padding: 0 16px !important;
371+
border: 1px solid #ccc !important;
372+
border-radius: 4px !important;
373+
font-family: Lato, Helvetica, Arial, sans-serif !important;
374+
font-size: 16px !important;
375+
color: #333e48 !important;
376+
box-sizing: border-box !important;
377+
background-color: #ffffff !important;
378+
}
379+
380+
/* Label width override */
381+
.mktoLabel {
382+
383+
}
384+
.mktoAsterix {
385+
float:left!important;
386+
margin-right: 4px!important;
387+
388+
}
389+
.mktoField {
390+
391+
}
392+
393+
394+
`;
395+
document.head.appendChild(formStyles);
396+
}
397+
);
398+
};
399+
document.body.appendChild(formScript);
400+
401+
402+
403+
})();
404+
</script>
405+
253406
</div>
254407

255408

99.6 KB
Loading

0 commit comments

Comments
 (0)