Skip to content

Instantly share code, notes, and snippets.

@sweetcard
sweetcard / InstanceRegistrationResource.java
Created May 6, 2024 04:07 — forked from PierreBesson/InstanceRegistrationResource.java
Eureka microservice manual registration
@RestController
@RequestMapping("registration")
public class InstanceRegistrationResource {
private final InstanceRegistrationService instanceRegistrationService;
public InstanceRegistrationResource(InstanceRegistrationService instanceRegistrationService) {
this.instanceRegistrationService = instanceRegistrationService;
}
@PostMapping("register")
@padeoe
padeoe / README_hfd.md
Last active May 31, 2024 00:57
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.
@btahir
btahir / semantic_search.py
Last active April 25, 2024 04:58
MVP For Semantic Search using Sentence Transformers + FAISS
# install packages
# pip install faiss-cpu sentence-transformers
import numpy as np
import torch
import faiss
import time
from sentence_transformers import SentenceTransformer
# https://www.sbert.net/docs/pretrained_models.html#multi-qa-models
@PierreBesson
PierreBesson / InstanceRegistrationResource.java
Created September 25, 2017 12:53
Eureka microservice manual registration
@RestController
@RequestMapping("registration")
public class InstanceRegistrationResource {
private final InstanceRegistrationService instanceRegistrationService;
public InstanceRegistrationResource(InstanceRegistrationService instanceRegistrationService) {
this.instanceRegistrationService = instanceRegistrationService;
}
@PostMapping("register")