Skip to content

Instantly share code, notes, and snippets.

View sugatoray's full-sized avatar
🎯
Focusing

Sugato Ray sugatoray

🎯
Focusing
View GitHub Profile
@sugatoray
sugatoray / great_tables_co2.py
Created May 1, 2024 04:44 — forked from chalg/great_tables_co2.py
Showcase electricity consumption data for 2023 from ElectricityMaps via Python great_tables
from great_tables import GT, md, html, system_fonts
import pandas as pd
power_cie_prepared_tbl = pd.read_csv("./data/2023_cie_power_cons.csv")
# Create a Great Tables object
ciep_gt_tbl = GT(data=power_cie_prepared_tbl)
# Apply wider color ranges & formatting
gt_tbl = ciep_gt_tbl \
@chalg
chalg / great_tables_co2.py
Last active May 13, 2024 07:15
Showcase electricity consumption data for 2023 from ElectricityMaps via Python great_tables
from great_tables import GT, md, html, system_fonts
import pandas as pd
power_cie_prepared_tbl = pd.read_csv("./data/2023_cie_power_cons.csv")
# Create a Great Tables object
ciep_gt_tbl = GT(data=power_cie_prepared_tbl)
# Apply wider color ranges & formatting
gt_tbl = ciep_gt_tbl \
@pdtgct
pdtgct / convert_hf_llama_to_ggml.md
Created April 28, 2023 15:27
Convert HF to GGML

The LLaMA model weights may be converted from Huggingface PyTorch format back to GGML in two steps:

  1. download from decapoda-research/llama-7b-hf and save as pytorch .pth
  2. use the ggerganov/llama.cpp script, convert-pth-to-ggml.py to convert from pytorch .pth to GGML

This process will result in ggml model with float16 (fp16) precision.

Prerequisite

@rasbt
rasbt / video-subtitles-via-whisper.py
Last active September 19, 2023 21:14
Script that creates subtitles (closed captions) for all MP4 video files in your current directory
# Sebastian Raschka 09/24/2022
# Create a new conda environment and packages
# conda create -n whisper python=3.9
# conda activate whisper
# conda install mlxtend -c conda-forge
# Install ffmpeg
# macOS & homebrew
# brew install ffmpeg
# Ubuntu
@sugatoray
sugatoray / setup.cfg
Created May 21, 2022 17:38 — forked from althonos/setup.cfg
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = martin.larralde@embl.de
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@marcosci
marcosci / olympus_hex.R
Created November 5, 2021 12:32
Hexagonal Rayshading
library(LaCroixColoR)
library(sf)
library(fasterize)
library(rayshader)
library(raster)
library(exactextractr)
library(rayrender)
# load raster into R
elevation <- raster("Olympus_Mons_ortho-image.tif")
@sugatoray
sugatoray / vscode_ssh_with_proxy.md
Last active October 25, 2021 02:32
SSH Tips and Tricks
@sugatoray
sugatoray / latex-open-in-overleaf-badge-example.md
Last active January 8, 2023 17:42
Open LaTeX in Overleaf directly from GitHub

overleaf-badge-image

Example badge: open-in-overleaf

[Overleaf][#overleaf] is an online service that allows you to create/edit/collaborate on LaTeX documents. For details on how the badge must be used, see the Example below.

  • Sample badge: Open in Overleaf
@MarcSkovMadsen
MarcSkovMadsen / holoviz_linked_brushing.py
Last active May 19, 2022 09:10
Linked brushing with HoloViz
# pip install panel==0.12.4 bokeh==2.4.0 holoviews==1.14.6 hvplot==0.7.3 shapely==1.7.1
# panel serve holoviz_linked_brushing.py --autoreload --show
import hvplot.pandas
import holoviews as hv
import panel as pn
from bokeh.sampledata.iris import flowers
pn.extension(sizing_mode="stretch_width")
hv.extension("bokeh")
@sugatoray
sugatoray / article_installing_tensorflow-gpu_using_conda.md
Last active May 19, 2023 14:21
Installing Tensorflow GPU + CuDNN + CudaToolkit with Conda

Install Tensorflow-GPU with Conda

I would suggest you to use conda (Ananconda/Miniconda) to create a separate environment and install tensorflow-gpu, cudnn and cudatoolkit. Miniconda has a much smaller footprint than Anaconda. I would suggest you to install Miniconda if you do not have conda already.

Quick Installtion