This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>waifu-magnet</title> | |
| <style> | |
| :root { | |
| --bg: #0a0a0b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """url-to-torr-stream.py | |
| ========================= | |
| Build a BitTorrent v1 `.torrent` (with webseeds) for files on HuggingFace, | |
| without keeping a full local copy on disk. | |
| Pull a whole repo, a subfolder, or just a handful of quant files — the | |
| torrent's webseeds point back at HuggingFace's CDN so qBittorrent / | |
| libtorrent / Transmission can download the content directly from HF | |
| without any peer needing the original `.torrent`-downloaded bytes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import lmdb | |
| lmdb_folder = '/path/to/strfry-db/' | |
| lmdb_env = lmdb.open(lmdb_folder, max_dbs=10) | |
| dbpl = lmdb_env.open_db(b'rasgueadb_defaultDb__EventPayload') | |
| dbid = lmdb_env.open_db(b'rasgueadb_defaultDb__Event__id') | |
| # read one event | |
| with lmdb_env.begin(db=dbid) as txn: | |
| with lmdb_env.begin(db=dbpl) as tpl: |