Skip to content

Commit

Permalink
Moved to a new repository and scrubbed credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
endomorphosis committed Mar 31, 2024
1 parent 216575b commit 2baa8a3
Show file tree
Hide file tree
Showing 96 changed files with 138,678 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules
package-lock.json
__pycache__
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Data Economy Hackathon
IPFS Huggingface Bridge

Author - Benjamin Barber
QA - Kevin De Haan

CLEANUP / Windows compatibility / Breakfix 03/31/2024 - 04/07/2024

# About

This is a model manager and wrapper for huggingface, looks up a index of models from an collection of models, and will download a model from either https/s3/ipfs, depending on which source is the fastest.

# How to use

setup.py

In your python script

from transformers import AutoModelForSeq2SeqLM
from ipfs_huggingface_bridge import AutoModelForSeq2SeqLM
model = AutoModelForSeq2SeqLM.from_auto_download("google/t5_11b_trueteacher_and_anli")

or

from transformers import AutoModelForSeq2SeqLM
from ipfs_huggingface_bridge import AutoModelForSeq2SeqLM
model = AutoModelForSeq2SeqLM.from_ipfs("QmWJr4M1VN5KpJjqCsJsJg7PDmFoqQYs1BKpYxcdMY1qkh")

To scrape huggingface

interactive prompt:

node scraper.js

import a model:

node scraper.js hf "modelname" (as defined in your .json files)

import all models

node scraper.js hf
1 change: 1 addition & 0 deletions collection.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions huggingface_scraper/checkpoint_diffusion_convert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import fs from 'fs'
import path from 'path'
30 changes: 30 additions & 0 deletions huggingface_scraper/checkpoint_gguf_convert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import fs from 'fs'
import path from 'path'
import os from 'os'

export function convert_fp32_to_gguf(path){
let this_file = __filename
let this_dir = path.dirname(this_file)
dest_path = path.replace(".ggml", ".gguf")
let command = "python3 " + this_dir + "/libllama/avx2/convert-ggml-gguf.py " + path + " " + dest_path
console.log("command is: " + command)
let results = os.system(command)
}

export function convert_fp16_to_gguf(path){
let this_file = __filename
let this_dir = path.dirname(this_file)
dest_path = path.replace(".ggml", ".gguf")
let command = "python3 "+ this_dir + "/libllama/avx2/convert-ggml-gguf.py " + path + " " + dest_path
console.log("command is: " + command)
let results = os.system(command)
}

export function convert_ggml_to_gguf(path){
let this_file = __filename
let this_dir = path.dirname(this_file)
dest_path = path.replace(".ggml", ".gguf")
let command = "python3 "+ this_dir + "/libllama/avx2/convert-ggml-gguf.py " + path + " " + dest_path
console.log("command is: " + command)
let results = os.system(command)
}
Loading

0 comments on commit 2baa8a3

Please sign in to comment.