Skip to content

loadnetwork/xans104

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

pip install xans104

Quick Start

from xans104 import load_model

MODEL_DATAITEM = "gESMyqhLntTn6zvldcUcSf0JfFpGDrQX6JKDKhKVf7k"
tokenizer, model, local_dir = load_model(MODEL_DATAITEM)
outputs = model.generate(**tokenizer("slop it", return_tensors="pt"))
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

load_model streams the .ans104 blob from https://gateway.s3-node-1.load.network, extracts it into a temporary directory and returns (tokenizer, model, path) so you can call HF APIs without handling files yourself.

Upload a HuggingFace repo to Load S3

from xans104 import create_model_dataitem

dataitem_id = create_model_dataitem(
    "sshleifer/tiny-gpt2",
    token="LOAD_API_TOKEN",
    tags={"key-1": "value-1"},
)
print(dataitem_id)

create_model_dataitem downloads the HF snapshot, tars it, sends it to load-s3-agent, and returns the dataitem_id ready for inference.

License

This repository is licensed under the MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published