Skip to content

Instantly share code, notes, and snippets.

View iamaziz's full-sized avatar
🎲

Aziz Alto iamaziz

🎲
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / Jais-LLM-GettingStarted-v2.ipynb
Last active April 16, 2024 16:59
Running Jais LLM on M3 Max chip with 64GB - using `torch_dtype=torch.float16`. Now much faster but way off
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / Jais-LLM-GettingStarted.ipynb
Created December 30, 2023 17:16
Running Jais LLM on M3 Max chip with 64GB - for some reason it's very slow and too big for a 13b model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / pytorch_device.py
Created December 30, 2023 06:57
Enable MacOS M-series chip for PyTorch
import torch
# Check if CUDA is available, else check for MPS, otherwise default to CPU
if torch.cuda.is_available():
device = torch.device("cuda") # GPU
elif torch.backends.mps.is_available():
device = torch.device("mps") # MacOS M-series chip
else:
device = torch.device("cpu") # CPU
@iamaziz
iamaziz / LLM-from-scratch.ipynb
Created July 23, 2023 17:02
Building a large language model (LLM) from scratch (for learning and fun - inspired by Llama2).
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / tf_practice_mnist_nn_normalized_vs-_non-normalized-data.ipynb
Created November 14, 2020 02:37
tf_practice_MNIST_nn_normalized_vs._non-normalized-data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / tf_practice_1_mini_linear_nn.ipynb
Created November 14, 2020 01:09
tf_practice_1_mini_linear_nn.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / clone_table_between_redshift_databases.ipynb
Created November 12, 2020 05:00
Clone table from one redshift database "cluster" to another via S3 (in Python)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / redshift_hook.py
Created October 31, 2020 01:04
Redshift Database Hook (adapter)
from __future__ import annotations
from functools import lru_cache, wraps
from psycopg2 import connect
from pandas import read_sql, DataFrame
class RedshiftDB:
"""Redshift Database Hook
USAGE:
@iamaziz
iamaziz / count-qura-an-words-v1.ipynb
Last active May 20, 2020 00:58
Count Qura'an Words - v1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.