How to Deploy AI Models? — Part 2 Setting up the Github For Herolu and Streamlit

--

Github is a platform which is available free and enables us to keep our codes in the cloud. Basically Github is a version control system it is used to keep logs of all the changes which are being made on the project. Github backbone is Git, it handles most of the operation of the Github. Github can be accessed by the Git CLI or Sourcetree (GUI Application). In Part -1 of this series (link) we have seen how to setup Github account with Git CLI in our local system.

You all will be thinking that why I am writing article on the Github and Git Sinstead of model deployment directly because our 90% problem will be solved automatically if we have our repository arranged in a specific way. Github has a very unique feature i.e. It is connected directly with many of the cloud platform such as heroku and streamlit -platform which provide free deployment of the python code using Flask or streamlit.

Before you start I will suggest you to register in Streamlin (link) and apply for an invitation from the community. In upcoming posts, we will be discussing model deployment on streamlit, so you will have access to your Stream lit account.

Big Data Jobs

Note : If you have set up the RSA authentication the use the SSH link else use the Https link of the repository

Without any delay lets start our journey ……

  1. Setting up Directory with the Git

In part 1 of this series, we have seen how we can connect our local system with the Github using RSA. By assuming that you have done the same we will start. First things first the first thing we have to do is we have to initialize the directory which we are going to upload in our Github repository using below command:

Command: git init

Trending AI Articles:

1. Preparing for the Great Reset and The Future of Work in the New Normal

2. Feature Scaling in Machine Learning

3. Understanding Confusion Matrix

4. 8 Myths About AI in the Workplace

The above command will create a git directory inside the our repository which will track all our action, image shows process, how we can initialize the repository.

Figure 1. Initialize the directory

2. Adding files to the track list

After the initialization of the directory next step is to add the files to the tracking list this can be done in many ways using but the efficient way is mentioned below.

Command: git add .

The above command will add files and folder to the tracking list inside the our repository which will track all files image shows process, how we can add files to the tracking list.

Figure 2. Initialize the directory

3. Committing the changes

After initialization and adding files in the tracking list. it’s time to save all the changes we have made in different files using commit

Command: git commit -m “Type your comments here”

This command will commit all the changes we have made to keep track of the difference with respect to the previous version of the file in .git directory. -m refers to the message we want to commit the file with.

Figure 3. Commiting Changes

4. Checking the status of the Repo

Sometimes we need to check the status of our repository that what files had been added or removed which files are being tracked which are not and many other information. It can be done by below command.

Command: git status

Figure 4. Commiting Changes

5. Pushing to the Github Repo

Pushing the repository is one of the frequently used commands in Git. It enables the respective person to push the code in the github repository. Initialize the directory with git init and commit the changes before pulling the respective repository. Create the blank repository in the Github before-hand.

Step 1:Creating Github Repo

Command : echo “# Demo” >> README.md

Step 2: Adding files to tract list the local repo and committing it

Command : git add .
git commit -m “first commit”

Step 3: Adding remote repository

Command : git remote add origin <repo link>

Step 4: Pushing the repository

Command : git push -u origin master

Figure 5. Pushing files to Github

6. Pulling from the Github Repo

Pulling the repository is one of the frequently used commands in Git. It enables the respective person to pull the code or other repository from different or from his on the repository. Initialize the directory with git init before pulling the respective repository.

Command: git pull<url of the repo>

Figure 6. Pulling the Repository

7. Cloning repo from the Github directory

Sometime we need to clone someone else repository for several purposes, git allow us to copy the full content of the repository in our local repository.

Command: git clone <url of the repo>

Figure 7. Cloning Repository

In the next article, we see how we can deploy the trained machine learning model in Heroku using our Github repository.

Special Thanks:

As we say “Car is useless if it doesn’t have a good engine” similarly student is useless without proper guidance and motivation. I will like to thank my Guru as well as my Idol “Dr. P. Supraja”- guided me throughout the journey, from the bottom of my heart. As a Guru, she has lighted the best available path for me, motivated me whenever I encountered failure or roadblock- without her support and motivation this was an impossible task for me.

If you have any query feel free to contact me with any of the -below mentioned options:

Website: www.rstiwari.com

Medium: https://tiwari11-rst.medium.com

Google Form: https://forms.gle/mhDYQKQJKtAKP78V7

Reference:

Extract installed packages and version : Article Link.

Installation of Git: Link,

Git Documentation: Link

Github Documentation: Link

Notebook Link Extract installed packages and version : Notebook Link

YouTube : Link

Don’t forget to give us your 👏 !

--

--