Hub Python Library
  • 🌍GET STARTED
    • Home
    • Quickstart
    • Installation
  • 🌍HOW-TO GUIDES
    • Overview
    • Download files
    • Upload files
    • BAFileSystem
    • Repository
    • Search
    • Inference
    • Community Tab
    • Collections
    • Cache
    • Model Cards
    • Manage your Space
    • Integrate a library
    • Webhooks server
  • 🌍CONCEPTUAL GUIDES
    • Git vs HTTP paradigm
  • 🌍REFERENCE
    • Overview
    • Login and logout
    • Environment variables
    • Managing local and online repositories
    • BOINC AI Hub API
    • Downloading files
    • Mixins & serialization methods
    • Inference Client
    • BaFileSystem
    • Utilities
    • Discussions and Pull Requests
    • Cache-system reference
    • Repo Cards and Repo Card Data
    • Space runtime
    • Collections
    • TensorBoard logger
    • Webhooks server
Powered by GitBook
On this page
  • Filesystem API
  • BaFileSystem
  1. REFERENCE

BaFileSystem

PreviousInference ClientNextUtilities

Last updated 1 year ago

Filesystem API

The BaFileSystem class provides a pythonic file interface to the BOINC AI Hub based on .

BaFileSystem

BaFileSystem is based on , so it is compatible with most of the APIs that it offers. For more details, check out and the fsspec’s .

class boincai_hub.BaFileSystem

( *args**kwargs )

Parameters

  • endpoint (str, optional) — The endpoint to use. If not provided, the default one () is used.

  • token (str, optional) — Authentication token, obtained with BaApi.login method. Will default to the stored token.

Access a remote BOINC AI Hub repository as if were a local file system.

Usage:

Copied

>>> from boincai_hub import BaFileSystem

>>> fs = BaFileSystem()

>>> # List files
>>> fs.glob("my-username/my-model/*.bin")
['my-username/my-model/pytorch_model.bin']
>>> fs.ls("datasets/my-username/my-dataset", detail=False)
['datasets/my-username/my-dataset/.gitattributes', 'datasets/my-username/my-dataset/README.md', 'datasets/my-username/my-dataset/data.json']

>>> # Read/write files
>>> with fs.open("my-username/my-model/pytorch_model.bin") as f:
...     data = f.read()
>>> with fs.open("my-username/my-model/pytorch_model.bin", "wb") as f:
...     f.write(data)

__init__

( *argsendpoint: typing.Optional[str] = Nonetoken: typing.Optional[str] = None**storage_options )

resolve_path

( path: strrevision: typing.Optional[str] = None )

ls

( path: strdetail: bool = Truerefresh: bool = Falserevision: typing.Optional[str] = None**kwargs )

List the contents of a directory.

🌍
fssepc
fsspec
our guide
API Reference
<source>
https://boincai.com
<source>
<source>
<source>