Skip to content

Instantly share code, notes, and snippets.

@paramaggarwal
paramaggarwal / llm-training-cost.md
Last active April 29, 2023 12:25
Prompt: LLM and novel approaches to reduce the cost of training them

Novel Approaches to Reduce the Cost of Training Large Language Models

Large language models (LLMs) have become increasingly popular in recent years due to their ability to process and understand human language. However, the cost of training these models can be prohibitively expensive, making it difficult for smaller organizations and researchers to access them. In this article, we will explore some novel approaches that can help reduce the cost of training LLMs.

  1. Knowledge Distillation
    Knowledge distillation is a technique that involves training a small, lightweight model to mimic the behavior of a larger, more complex model. This can be used to reduce the computational cost of training LLMs by creating a smaller, more efficient model that still performs at a high level. The smaller model can then be used for inference, while the larger model can continue to be trained or used for other purposes.

  2. Transfer Learning
    Transfer learning is a technique that involves using a pre-trained model as

@paramaggarwal
paramaggarwal / cards.csv
Last active March 31, 2023 09:50
Best Indian Credit/Debit Cards for International Travel (2023)
Name Type Setup Cost Forex Markup ATM Fees
6E Rewards XL (HDFC) Credit Rs. 3000 2.5% Rs. 2500 + 2.5%
Millennia (HDFC) Debit Zero 3.5% Rs. 150 + 3.5%
OneCard (Federal) Credit Zero 1% Unavailable
TripMoney Global (SBM) Credit Rs. 500 preload 0% Rs. 450 + 0%
Niyo Global (SBM) Debit Unavailable Unavailable Unavailable
Niyo Global (SBM) Credit Rs. 5000 FD 0% Rs. 300 + 0%
Fi Money (Federal) Debit Zero 2.5% Rs. 200 + 2.5%
Jupiter (Federal) Debit Rs. 250 preload + Rs. 199 charge 3.5% Rs. 100 + 3.5%
@paramaggarwal
paramaggarwal / async_await.js
Last active March 22, 2022 03:51
Trying out some concepts of Promise and async/await in Javascript.
function waiter(str) {
return new Promise((resolve, reject) => {
return setTimeout(() => resolve(str), 1000)
})
}
await waiter('one').then((res) => waiter(res + 'two'))
// 'onetwo'
await waiter('one').then((res) => { waiter(res + 'two') })
@paramaggarwal
paramaggarwal / flex-grid.md
Last active June 10, 2021 01:36
Build a Smart Grid Layout using Flexbox

Build a Smart Grid Layout using Flexbox

Learn how to use Flexbox layout to dynamically resize elements in multiple columns and ensure your content looks great!

When laying out content inside our web or mobile app we need to ensure things are fluidly responsive and fill the screen. This requires that we have items that expand to take up the full width equally, but we also want these items to wrap into a new row when there are too many of them.

This article assumes you are already familiar with the basics of Flexbox layout. To brush up, there is a great playground here: https://flexbox.tech

We know that we need flex-direction: row here to specify that the items should flow horizontally. We also know that we need flex-wrap: wrap so that these items flow into a new row once they fill the width.

But we also want these items to resize to fill the width that is available to them after reflowing.

@paramaggarwal
paramaggarwal / README.md
Last active May 24, 2021 08:35
Node.js script to check for CoWin Vaccine API and speak available slots

Queries the API every 5 seconds and uses the macOS say command to announce the available slots.

@paramaggarwal
paramaggarwal / redis_monitor_parser.rb
Last active May 15, 2021 14:45 — forked from bohford/redis_monitor_parser.rb
Redis monitor log parser
# redis-cli monitor > monitor.txt
puts "Scanning redis log..."
ops = Hash.new(0)
lines = File.readlines('monitor.txt'); true
start_time = Time.at(lines[1].split(' ').first.to_f)
end_time = Time.at(lines.last.split(' ').first.to_f)
@paramaggarwal
paramaggarwal / README.md
Last active March 23, 2021 03:04
Delete all git tags on remote with particular prefix

Delete all git tags on remote with particular prefix

This will remove all tags with the prefix PREFIX from the remote branch. After that sync your local history with remote.

  • git for-each-ref 'refs/tags/PREFIX*' --format='%(refname:short)' | xargs git push --delete origin
  • git fetch --prune --prune-tags
@paramaggarwal
paramaggarwal / README.md
Last active April 9, 2023 18:08
How to authorise Audible in Books app on macOS Big Sur

How to authorise Audible in Books app on macOS Big Sur

As of this writing the token auth flow is broken due to the following reasons:

  1. The country based override causes failure of the "Activate in iTunes" button to show up.
  2. Once the button exists, it attempts to open the Music app rather than the Books app.

Step 0

Before attempting any of this, go to Audible library and download your audiobook and open it, it will get added to Books app on macOS. Now try to play it and it will as for permission to authorise it.

@paramaggarwal
paramaggarwal / index.html
Created March 20, 2020 12:45
Trying Web Bluetooth
<html>
<script>
function onButtonClick() {
const serviceUuid = "body_composition";
console.log("Requesting Bluetooth Device...");
navigator.bluetooth
.requestDevice({ filters: [{ services: [serviceUuid] }] })
.then(device => {
console.log("Connecting to GATT Server...");
@paramaggarwal
paramaggarwal / clip.svg
Last active January 17, 2020 11:02
Energy Meter Dashed Gradient Progress
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.