Skip to content

Parakeet text cleanups #1193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 28, 2025
Merged

Conversation

zhang-lucy
Copy link
Contributor

Type of Change

  • New example for the GitHub repo
    • New example for the documentation site (Linked from a discoverable page, e.g. via the sidebar in /docs/examples)
  • Example updates (Bug fixes, new features, etc.)
  • Other (Changes to the codebase, but not to examples)

Documentation Site Checklist

☑️ Monitoring

  • Example is configured for testing in the synthetic monitoring system
    • Example is tested by executing with modal run, or an alternative cmd is provided in the example frontmatter (e.g. cmd: ["modal", "serve"])
    • Example is tested by running the cmd with no arguments, or the args are provided in the example frontmatter (e.g. args: ["--prompt", "Formula for room temperature superconductor:"]
    • Example does not require third-party dependencies besides fastapi to be installed locally (e.g. does not import requests or torch in the global scope or other code executed locally)

☑️ Content

  • Example is documented with comments throughout, in a Literate Programming style
  • All media assets for the example that are rendered in the documentation site page are retrieved from modal-cdn.com

☑️ Build Stability

  • Example pins all dependencies in container images
    • Example pins container images to a stable tag like v1, not a dynamic tag like latest
    • Example specifies a python_version for the base image, if it is used
    • Example pins all dependencies to at least SemVer minor version, ~=x.y.z or ==x.y, or we expect this example to work across major versions of the dependency and are committed to maintenance across those versions
      • Example dependencies with version < 1 are pinned to patch version, ==0.y.z

Outside Contributors

You're great! Thanks for your contribution.

@zhang-lucy zhang-lucy force-pushed the zhang-lucy/parakeet-cleanup branch from 7788457 to 29b704b Compare May 22, 2025 20:10
@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-bd2d836.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-61c1417.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-d4e954b.modal.run

@@ -275,9 +278,7 @@ def main(audio_url: str = AUDIO_URL):
# Below are the three main functions that coordinate streaming audio and receiving transcriptions.
#
# `send_audio` transmits chunks of audio data and then pauses to approximate streaming
# speech at a natural rate. That said, we set it to faster
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought this was a bit too honest 😅

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say the prose is too casual.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll resist defending the tone of this sentence. But it might be worth mentioning that we set it to faster than realtime just so people understand why we divide the wait time by 8 (i.e. wait for 1/8th the duration of the chunk we just sent).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably okay to not mention it. it's not crucial or the focus here.

@zhang-lucy zhang-lucy requested review from charlesfrye and shababo May 22, 2025 20:33
@zhang-lucy zhang-lucy marked this pull request as ready for review May 22, 2025 20:33
@zhang-lucy zhang-lucy force-pushed the zhang-lucy/parakeet-cleanup branch from 942ceb2 to eabfaf1 Compare May 22, 2025 20:33
@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-43bff72.modal.run

# ...
# ```
# See [Troubleshooting](https://modal.com/docs/examples/parakeet#client) at the bottom if you run into issues.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the Troubleshooting section anymore.

@zhang-lucy zhang-lucy changed the title [draft] Parakeet text cleanups Parakeet text cleanups May 22, 2025
@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-694f621.modal.run

Copy link
Collaborator

@shababo shababo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking another pass at this!


# - run the browser/microphone frontend, or
# - Run the browser/microphone frontend. Modal handles the deployment of both the frontend and backend in a single app! You should see a browser window pop up - make sure you allow access to your microphone. The full frontend code can be found [here](https://github.com/modal-labs/modal-examples/tree/main/06_gpu_and_ml/audio-to-text/frontend).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Do we need the callout to it being a single app?

  2. For me the browser window does not pop up automatically... I have to click the link in the terminal. Does it automatically open for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I always think it's so cool but defer to you guys
  2. Oh good catch; will fix


# ```bash
# 🌐 Downloading audio file...
# 🎧 Downloaded 6331478 bytes
# ☀️ Waking up model, this may take a few seconds on cold start...
# 📝 Transcription: A Dream Within A Dream Edgar Allan Poe
# 📝 Transcription:
# 📝 Transcription: take this kiss upon the brow, And in parting from you now, Thus much let me avow You are not wrong who deem That my days have been a dream.
# 📝 Transcription: Take this kiss upon the brow,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't actually break up the lines like this in the output... do we want it to be the actual output or this better looking one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda like the better looking one but defer to you guys if that's dishonest 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Movie magic yk

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charlesfrye what's the Modal-Frye Style Guide say here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think splitting on punctuation with newlines in the code is a good idea! I'd like for the output to be real.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charlesfrye i feel like coding that is a can of worms. like, just breaking on , or . could have false positives. right now line breaks are based on speech breaks. using a poem as the example is fun but complicates this a bit.

@@ -275,9 +278,7 @@ def main(audio_url: str = AUDIO_URL):
# Below are the three main functions that coordinate streaming audio and receiving transcriptions.
#
# `send_audio` transmits chunks of audio data and then pauses to approximate streaming
# speech at a natural rate. That said, we set it to faster
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll resist defending the tone of this sentence. But it might be worth mentioning that we set it to faster than realtime just so people understand why we divide the wait time by 8 (i.e. wait for 1/8th the duration of the chunk we just sent).

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-b852fe8.modal.run

@zhang-lucy zhang-lucy requested a review from charlesfrye May 25, 2025 13:50
@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-ed65e78.modal.run

@@ -376,3 +377,27 @@ def preprocess_audio(audio_bytes: bytes) -> bytes:
def chunk_audio(data: bytes, chunk_size: int):
for i in range(0, len(data), chunk_size):
yield data[i : i + chunk_size]


def output_message_as_transcript(message: str):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be weird. At the very least we shouldn't change the punctuation and just do a word wrap where we limit the number of chars per line. @charlesfrye thoughts on this?

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-11af6fe.modal.run

@charlesfrye
Copy link
Collaborator

@prbot automerge

@modal-pr-review-automation modal-pr-review-automation bot merged commit 1d80e4f into main May 28, 2025
7 checks passed
@modal-pr-review-automation modal-pr-review-automation bot deleted the zhang-lucy/parakeet-cleanup branch May 28, 2025 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants