Skip to content

Instantly share code, notes, and snippets.

View BurakaKrishna's full-sized avatar
🎯
Focusing

Buraka BurakaKrishna

🎯
Focusing
  • India,Bangalore
View GitHub Profile
@BurakaKrishna
BurakaKrishna / normcore-llm.md
Created August 29, 2023 08:54 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
@BurakaKrishna
BurakaKrishna / llama-home.md
Created May 14, 2023 19:57 — forked from rain-1/llama-home.md
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@BurakaKrishna
BurakaKrishna / explode_method.txt
Created December 6, 2019 09:21
pandas explode method for versions < 0.25.0
import numpy as np
values = df[column].tolist()
n = len(df[column].tolist())
counts = np.zeros(n, dtype='int64')
for i in range(n):
v = values[i]
if len(v):
counts[i] += len(v)
else:
# empty list-like, use a nan marker
@BurakaKrishna
BurakaKrishna / neural_node_backpropagation.py
Last active November 19, 2018 14:31
Python code for Hacker's guide to Neural Networks - Andrej Karpathy blog
#Understanding neural networks
#Random approach
def forward_multiply_gate(x,y):
return x*y
x = -2
y = 3
tweak_amount = 0.01
import random
@BurakaKrishna
BurakaKrishna / remove_output.py
Created August 17, 2018 06:21 — forked from damianavila/remove_output.py
Remove output from IPython notebook from the command line (dev version 1.0)
"""
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
Modified from remove_output by Minrk
"""
import sys
import io
import os
from IPython.nbformat.current import read, write
import string
import math
tokenize = lambda doc: doc.lower().split(" ")
document_0 = "China has a strong economy that is growing at a rapid pace. However politically it differs greatly from the US Economy."
document_1 = "At last, China seems serious about confronting an endemic problem: domestic violence and corruption."
document_2 = "Japan's prime minister, Shinzo Abe, is working towards healing the economic turmoil in his own country for his view on the future of his people."
document_3 = "Vladimir Putin is working hard to fix the economy in Russia as the Ruble has tumbled."
document_4 = "What's the future of Abenomics? We asked Shinzo Abe for his views"
@BurakaKrishna
BurakaKrishna / gist:25565366349562e7c2c9f1e5d2e3b8f0
Created January 12, 2018 10:01 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@BurakaKrishna
BurakaKrishna / cmd.sh
Created November 13, 2015 07:49 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@BurakaKrishna
BurakaKrishna / bobp-python.md
Created November 9, 2015 08:28 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens