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
@padeoe
padeoe / README_hfd.md
Last active February 27, 2025 16:25
CLI-Tool for download Huggingface models and datasets with aria2/wget: hfd

🤗Huggingface Model Downloader

Note

(2025-01-08) Add feature for 🏷️Tag(Revision) Selection, contributed by @Bamboo-D.
(2024-12-17) Add feature for ⚡Quick Startup and ⏭️Fast Resume, enabling skipping of downloaded files, while removing the git clone dependency to accelerate file list retrieval.

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 leverages curl and aria2c for fast and robust downloading of models and datasets.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
@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
@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))
@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) {
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active February 6, 2025 14:35
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.




@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
@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):