SLMs - How to run Phi-2 Locally, and implement RAG

1. What are Small Language Models (SLMs)? Before diving into running Phi-2 locally, let’s take a moment to understand the concept of small language models (SLMs) and their significance in natural language processing (NLP). A SLM is a type of AI model that has been trained on a massive dataset of text but is limited in terms of its size and capabilities compared to a Large Language Model (LLM). SLMs are designed to be more lightweight and efficient, making them suitable for various applications, including chatbots, language translation, and content generation....

March 13, 2024 · Amit Bahree

Shedding Light on the Art of Prompt Engineering

How many prompt engineers does it take to change a light bulb? Just one, but first, they need to fine-tune the model to make sure the AI doesn’t end up writing a poem about darkness instead. DALLE generated image of How many engineers it take to change a light bulb

February 28, 2024 · Amit Bahree

📚 My new book "Generative AI in Action"

🌐 As software continues to revolutionize the world, the advent of Generative AI is transforming the very fabric of software itself. My latest book, Generative AI in Action delves into this transformative journey. I am thrilled to announce the early release of my latest book, Generative AI in Action now available through Manning Early Access Program (MEAP) . This publication is a deep dive into the cutting-edge world of #GenerativeAI, #LLMs, #OpenAI, and #Azure #OpenAI, tailored specifically for enterprises....

November 14, 2023 · Amit Bahree

OpenAI's Whisper speech model - an overview

What is Whisper from OpenAI? Whisper is a speech recognition model (ASR – automatic speech recognition) from OpenAI. The model itself is multi-task model and as a result in addition to speech recognition, can also do language identification and speech translation across a number of languages. The model is open sourced and it comes in 5 sizes. Of these, 4 have a english-only variant which seem to perform better if one only needs english....

February 28, 2023 · Amit Bahree

Hello New Bing 👋

Bing is getting a new look and feel, powered by Microsoft AI and OpenAI (ChatGPT) and was announced yesterday. There is a lot of buzz around this, and I thought I would share my thoughts on this as I got access today. What is the new Bing? Well, it is the thing that is making the 800-pound gorilla in the room, Google, come out and dance on its toes. 🦍...

February 9, 2023 · Amit Bahree

Using CoPilot beyond code

In the last week or so, all the range online has been #OpenAI’s new chatbot called #ChatGPT (you can read more details on ChatGPT here ). This also got me thinking, about how can we use #CoPilot more than just code. GitHub CoPilot as you might recall is your #AI powered pair-programmer. And as we can see below, it indeed is possible to use Codex as sort of a more general purpose usage....

December 10, 2022 · Amit Bahree

Hello ChatGPT

OpenAI recently released #ChatGPT , a GPT-3 based chatbot that can be used to chat with. ChatGPT is a fine-tuned model of GPT3.5 , using #RL (specifically a PPO algorithm) similar to the Instruct series. This post is my experience in using it. Blog post with ChatGPT What better place to start with, than asking it about itself? 😃 Prompt: write me a blog post, about writing a blog post using a ai powered chatbot...

December 4, 2022 · Amit Bahree

AI generated text-to-video

Here is an example of how one can use a text prompt to generate a series of frames, that then are stitched together into a video. The prompt I used was: “a man walking in the parking lot with a miniature poodle”. the final video generated is shown below. There should have been a video here but your browser does not seem to support it. AI-generated video from a text prompt of a man walking in a parking lot with a miniature poodle...

October 11, 2022 · Amit Bahree

AI writing AI code🤐

It is 2021. And we have #AI writing #AI code. 🤪 It is quite interesting, but also can be quite boring once you get beyond the initial technology, and just think of it as one of the tools in your arsenal. And getting to that point is a good think. As part of a think at work I recently started playing with GitHub Copilot , which is using GPT3 to be your pair programmer – helping write code....

October 10, 2021 · Amit Bahree

Reinforcement Learning - An Introduction

Reinforcement Learning is teaching by example – it is how most of us learn. Reinforcement Learning (#RL) is a different approach to ML – it is a set of techniques that allows AI algorithms to experiment and learn from experience. RL falls in between supervised and unsupervised learning – there isn’t any labeled data, but at the same time it isn’t unsupervised either. At its most simple form, RL is a computational approach for automating goal-oriented decision making and learning....

July 16, 2021 · Amit Bahree

GPT-3 vs other AI powered assistants

I have been kicking the tires with Open AI’s #GPT-3 . Based on the screenshot below, it might be easy to think “oh boy does the model think highly of itself”, but as with most things in life - the devil is in the details.😃 The screenshot below was a forked version of davinci engine and follows the Q&A structure. GPT-3 vs other AI assistants Using OpenAI’s API is quite simple; perhaps too simple!...

June 21, 2021 · Amit Bahree

ML algorithm cheat sheet

A #ML algorithm cheat sheet - helping narrow down to a certain set of #algorithm grouping depending on the problem at hand and what we are trying to solve from a business perspective. ML algorithm cheat sheet Figure 2 shows what additional characteristics we need to consider when choosing the right ML algorithm for your situation at hand. This is something that cannot be generic and is very situational. Characteristics in selecting ML algorithms If you find this useful, I would also recommend reading “ How to select algorithms ” which is detailed as part of Azure ML designer ....

May 3, 2021 · Amit Bahree

bfloat16 - how it improves AI chip designs

Floating point calculations are slow for computers (specifically CPUs); possibly representing the same struggle for many humans. :) I remember a time when a FPU (floating point unit) was an upgrade and one had to pay extra to get one. Very useful when you needed that extra precision in computing - and in my head, it always seemed like the Turbo button. :) For most #ML workloads and computations, precision isn’t the most important criteria; with every increasing data and parameters (looking at you GPT-3 with 45 TB of data and 175 billion parameters!...

September 12, 2020 · Amit Bahree

ML Algorithms

Sometimes one needs a quick snapshot of what are the options to think through and I really like this for that. Machine Learning Algorithms

June 13, 2019 · Amit Bahree

Machine Learning 101

May 16, 2019 · Amit Bahree

Getting DonkeyCar working on a Mac

I have been playing with a #selfdriving car for a while , and that is super exciting. From a #AI and #ML perspective it is small scale but allows one to exploit all aspects of the tech stack and also appreciate the limitations of not only the software but also the hardware. With this, You run a NN on a raspberry pi that uses TensorFlow, and Keras and run inference on the edge....

March 12, 2019 · Amit Bahree

Azure Cognitive Services in containers is the smart way to go

{Cross posted from my post on Avanade } Containers just got smarter. That’s the news from Microsoft, which announced recently that Azure Cognitive Services now supports containers . The marriage of AI and containers is a technology story, of course, but it’s a potentially even bigger business story, one that affects where and how you can do business and gain competitive advantage. First, the technology story Containers aren’t new, of course....

January 13, 2019 · Amit Bahree

Roots of #AI

The naming is unfortunate when talking about #AI. There isn’t anything about intelligence - not as we humans know of it. If we can rewind back to the 50’s we can perhaps rename it to something like Computational Intelligence, which is more accurate. And although I have outlined the difference between some of the elements of AI in the past, I wanted to get back to what the intent was and how this area started....

November 12, 2018 · Amit Bahree

#ML concepts - Regularization, a primer

Regularization is a fundamental concept in Machine Learning (#ML) and is generally used with activation functions . It is the key technique that help with overfitting. Overfitting is when an algorithm or model ‘fits’ the training data too well - it seems to good to be true. Essentially overfitting is when a model being trained, learns the noise in the data instead of ignoring it. If we allow overfitting, then the network only uses (or is more heavily influenced) by a subset of the input (the larger peaks), and doesn’t factor in all the input....

September 29, 2018 · Amit Bahree

Neural Network - Cheat Sheet

Neural Networks, today, help in a great set of tasks, that until very recently wasn’t possible at all - be it from computer vision, to medical diagnosis, to speech translation and forms a key cornerstone to a lot of ‘magic’ that Machine Learning and AI offers today. I did blog about Neural Network types (and MarI/O) sometime back ; I surely cannot take credit for creating these three cheat sheets but they are awesome and hope you get to use and enjoy them too....

September 11, 2018 · Amit Bahree

The merits of #AI

Thought of the week: Artificial Intelligence stands no chance against natural Stupidity. #ArtificalIntelligence

July 2, 2018 · Amit Bahree

#ML training data

Seem like my training data for the car - perhaps a hint of #bias. 😂 #GeekyJokes #ML #AIJokes

June 15, 2018 · Amit Bahree

Neural network basics & Activation functions

Neural networks have a very interesting aspect – they can be viewed as a simple mathematical model that defines a function. For a given function $f(x)$ which can take any input value of $x$, there will be some kind a neural network satisfying that function. This hypothesis was proven almost 20 years ago (“ Approximation by Superpositions of a Sigmoidal Function ” and “ Multilayer feedforward networks are universal approximators ”) and forms the basis of much of #AI and #ML use cases possible ....

June 12, 2018 · Amit Bahree

Netron - deep learning and machine learning model visualizer

I was looking at something else and happen to stumble across something called Netron , which is a model visualizer for #ML and #DeepLearning models. It is certainly much nicer than for anything else I have seen. The main thing that stood out for me, was that it supports ONNX , and a whole bunch of other formats (Keras, CoreML), TensorFlow (including Lite and JS), Caffe, Caffe2, and MXNet. How awesome is that?...

June 11, 2018 · Amit Bahree

Machine learning use-cases

Someone recently asked me, what are some of the use cases / examples of machine learning. Whilst, this might seem as an obvious aspect to some of us, it isn’t the case for many businesses and enterprises – despite that they uses elements of #ML (and #AI) in their daily life – as a consumer. Whilst, the discussion gets more interesting based on the specific domain and the possibly use cases (of course understanding that some might not be sure f the use case – hence the question in the first place)....

June 5, 2018 · Amit Bahree