Skip to content

Instantly share code, notes, and snippets.

View padeoe's full-sized avatar
😀
AI for ever.

padeoe

😀
AI for ever.
View GitHub Profile
@rashkur
rashkur / chrome_icon_fixer
Created September 7, 2014 19:59
chrome icon fixer
import ConfigParser, mmap
config_file = "/usr/share/applications/google-chrome.desktop"
add_string_to_each_section = ["StartupWMClass", "Google-chrome-stable"]
option = add_string_to_each_section[0]
value = add_string_to_each_section[1]
class Fixer:
def check(self, cf, option, value):
@minazou67
minazou67 / howto-upgrade-debian-jessie-kernel.md
Last active August 13, 2019 18:13
How to upgrade the Linux Kernel of debian 8 jessie

How to upgrade the Linux Kernel of debian 8 jessie

Debian 8 のカーネルをアップグレードする方法です。

Environment

  • Microsoft Windows Server 2012 R2
  • Hyper-V
  • Debian 8.2 jessie
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active June 18, 2024 08:05
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@jimschubert
jimschubert / Markdown-JavaScript.markdown.js
Last active September 24, 2023 13:31
DataGrip (IntelliJ) output SQL results to Markdown
if (!String.prototype.repeat) {
// polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
String.prototype.repeat = function(count) {
'use strict';
if (this == null) {
throw new TypeError('can\'t convert ' + this + ' to object');
}
var str = '' + this;
count = +count;
if (count != count) {
@raven4752
raven4752 / keras_limit.py
Last active February 2, 2023 13:42
limit gpu memory usage of keras
#put the these lines before importing any module from keras.
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.gpu_options.visible_device_list = "0" #only the gpu 0 is allowed
set_session(tf.Session(config=config))
@raven4752
raven4752 / gist:3669ac1cf4aa7f9faf63d3328cd507f7
Created July 11, 2018 09:56
callback to save best model and early stopping with multi-input/multi-output using custom score functions
import numpy as np
import pandas as pd
from keras.callbacks import Callback
class ScoreMetric(Callback):
def __init__(self, score_func, num_input=1, num_target=1):
super(ScoreMetric, self).__init__()
self.num_input = num_input
self.num_target = num_target
self.score_func = score_func
@padeoe
padeoe / README_hfd.md
Last active July 3, 2024 05:34
CLI-Tool for download Huggingface models and datasets with aria2/wget+git

🤗Huggingface Model Downloader

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, this command-line tool smartly utilizes wget or aria2 for LFS files and git clone for the rest.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
  • 🚀 Multi-threaded Download: Utilize multiple threads to speed up the download process.
  • 🚫 File Exclusion: Use --exclude or --include to skip or specify files, save time for models with duplicate formats (e.g., *.bin or *.safetensors).
  • 🔐 Auth Support: For gated models that require Huggingface login, use --hf_username and --hf_token to authenticate.
  • 🪞 Mirror Site Support: Set up with HF_ENDPOINT environment variable.