<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abraham Jerry Kakooza</title>
    <description>The latest articles on DEV Community by Abraham Jerry Kakooza (@kakoozajerry).</description>
    <link>https://dev.to/kakoozajerry</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F538301%2F7cf689b5-f97e-4dd8-b074-4ddb2cb6bc91.jpeg</url>
      <title>DEV Community: Abraham Jerry Kakooza</title>
      <link>https://dev.to/kakoozajerry</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kakoozajerry"/>
    <language>en</language>
    <item>
      <title>Deploying an English Speech to Text model to heroku</title>
      <dc:creator>Abraham Jerry Kakooza</dc:creator>
      <pubDate>Wed, 16 Mar 2022 17:12:42 +0000</pubDate>
      <link>https://dev.to/kakoozajerry/deploying-an-english-speech-to-text-model-to-heroku-3o76</link>
      <guid>https://dev.to/kakoozajerry/deploying-an-english-speech-to-text-model-to-heroku-3o76</guid>
      <description>&lt;p&gt;I will be showing you how to deploy the coqui-ai english speech to text model on heroku such that you can use it within your applications.&lt;/p&gt;

&lt;p&gt;The model we will deploy can be found &lt;a href="https://coqui.ai/english/coqui/v1.0.0-large-vocab" rel="noopener noreferrer"&gt;here&lt;/a&gt; . It is a large vocab English speech to text model.&lt;/p&gt;

&lt;p&gt;First within your terminal, clone this &lt;a href="https://github.com/KakoozaJerry/en-stt-engine.git" rel="noopener noreferrer"&gt;repository&lt;/a&gt; as shown below and navigate into the &lt;code&gt;en-stt-engine&lt;/code&gt; directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/KakoozaJerry/en-stt-engine.git
&lt;span class="nb"&gt;cd &lt;/span&gt;en-stt-engine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure you have git lfs installed on your machine, you can find instructions &lt;a href="https://git-lfs.github.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Run the command below after installing git lfs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git lfs &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It should return something like what is below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Updated git hooks.
Git LFS initialized.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open your heroku in the browser and type the link below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dashboard.heroku.com/new-app" rel="noopener noreferrer"&gt;https://dashboard.heroku.com/new-app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Incase you are not logged in you will be prompted to do so.&lt;br&gt;
Your webpage should return the view below, where you can input the name you want for the app, I use &lt;code&gt;english-stt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr80mizh60kz0qxxlr2sw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr80mizh60kz0qxxlr2sw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can go back to your terminal and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;heroku login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see the log below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;heroku: Press any key to open up the browser to login or q to &lt;span class="nb"&gt;exit&lt;/span&gt;: 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press any key as stated and click the login button shown in the browser, if successful this will show.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Opening browser to https://cli-auth.heroku.com/auth/cli/browser/......
Logging &lt;span class="k"&gt;in&lt;/span&gt;... &lt;span class="k"&gt;done
&lt;/span&gt;Logged &lt;span class="k"&gt;in &lt;/span&gt;as user@gmail.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set the name of the remote origin from heroku app you created above using the command below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;heroku git:remote &lt;span class="nt"&gt;-a&lt;/span&gt; &amp;lt;stt-app-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should return&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;set &lt;/span&gt;git remote heroku to https://git.heroku.com/&amp;lt;stt-app-name&amp;gt;.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specify the heroku python as your build pack as shown below in your terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;heroku buildpacks:set heroku/python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is what it should return&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Buildpack set. Next release on english-stt will use heroku/python.
Run git push heroku main to create a new release using this buildpack.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the ffmpeg buildpack since this will also be needed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;heroku buildpacks:add https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below is what it should return&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Buildpack added. Next release on english-stt will use:
  1. heroku/python
  2. https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
Run git push heroku main to create a new release using these buildpacks.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add git-lfs buildpack using the command below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;heroku buildpacks:add https://github.com/raxod502/heroku-buildpack-git-lfs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is what will be returned&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Buildpack added. Next release on english-stt will use:
  1. heroku/python
  2. https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
  3. https://github.com/raxod502/heroku-buildpack-git-lfs
Run git push heroku main to create a new release using these buildpacks.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set your &lt;code&gt;HEROKU_BUILDPACK_GIT_LFS_REPO&lt;/code&gt; variable to point to the github repository as shown below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;heroku config:set &lt;span class="nv"&gt;HEROKU_BUILDPACK_GIT_LFS_REPO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://github.com/KakoozaJerry/en-stt-engine.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is what will be returned&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Setting HEROKU_BUILDPACK_GIT_LFS_REPO and restarting ⬢ english-stt... &lt;span class="k"&gt;done&lt;/span&gt;, v6
 ▸    Warning: The &lt;span class="s2"&gt;"HEROKU_"&lt;/span&gt; namespace is protected and shouldn&lt;span class="s1"&gt;'t be used.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should be able to publish your app using this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push heroku main:master &lt;span class="nt"&gt;--no-verify&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will take a while depending on the speed of your internet&lt;/p&gt;

&lt;p&gt;After a successful deployment, you should see successful deployment and you can test out your stt api in postman as shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs3vbx50se8mdiidtr6fl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs3vbx50se8mdiidtr6fl.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can test it out with this &lt;a href="https://github.com/KakoozaJerry/en-stt-engine/blob/main/audio.wav" rel="noopener noreferrer"&gt;audio&lt;/a&gt; and a key value of &lt;code&gt;file&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Make sure to select form data as shown in the screenshot above.&lt;/p&gt;

</description>
      <category>speechtotext</category>
      <category>stt</category>
      <category>heroku</category>
      <category>deployment</category>
    </item>
  </channel>
</rss>
