Skip to main content

HuggingButt

Client library to download and publish reinforcement learning environments/agents on the huggingbutt.com hub

Installation

The base dependency mlagents-envs has been update to version 1.0.0. However, this version may rise an error Issue 5996(on Windows 10). So I specified mlagents-envs==0.30.0, NumPy==1.21.2 in this project. I did not found this issue on MacOS.

Create a new python environment using anaconda/miniconda. Only Python 3.9!!

conda create -n hb python==3.9.18

activate the new python environment.

conda activate hb

install huggingbutt from pypi

pip install huggingbutt==0.0.5

or from source code

git clone -b v0.0.5 https://github.com/huggingbutt/huggingbutt.git
cd huggingbutt
python -m pip install .

If there is no error message printed during the installation, congratulations, you have successfully installed this package. Next, you need to apply an access token from the official website https://huggingbutt.com.

Register an account and login, just do as shown in the image below.

image

Click new token button generate a new token. This access token is mainly used to restrict the download times of each user, as the server cost is relatively high.

image

Congratulations, you now have an access token!

image

Just put the generated token in the task code and you're gooooood to go.

Here is a simple training code:

from huggingbutt import Env, Agent, set_access_token

if __name__ == '__main__':
    set_access_token('YOUR_TOKEN')
    env = Env.get("huggingbutt/juggle", 'mac', startup_args=['--time_scale', '10'])

    agent = Agent(
        env=env,
        algorithm='PPO',
        policy='MlpPolicy',
        batch_size=64
    )
    agent.learn(total_timesteps=10000)
    agent.save()
    env.close()

Inference:

from huggingbutt import Env, Agent, set_access_token

if __name__ == '__main__':
    set_access_token('YOUR_TOKEN')
    env = Env.get("huggingbutt/juggle", 'mac', startup_args=['--time_scale', '1'])
    agent = Agent.get(15, env)

    obs = env.reset()
    for i in range(100):
        act, _status_ = agent.predict(obs)
        obs, reward, done, info = env.step(act)
        if done:
            obs = env.reset()
    env.close()

todo

  1. Support more types learning environment, such as native game wrapped by python, pygame, class gym...
  2. Develop a framework, user can customize the observation, action and reward of the environment developed under this framework. I hope this makes it easier for everyone to iterate the environment's agent.
  3. There are still many ideas, I will add them later when I think about them...

Metadata

Release files for huggingbutt 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for huggingbutt 0.0.5
File Size Uploaded Provenance Actions
huggingbutt-0.0.5.tar.gz 16.6 kB Without provenance Details for huggingbutt-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for huggingbutt 0.0.5
File Interpreter ABI Platform Actions
huggingbutt-0.0.5-py3-none-any.whl Python 3 none any Details for huggingbutt-0.0.5-py3-none-any.whl

Total release size: 34.5 kB

Release files / huggingbutt-0.0.5.tar.gz

Download URL huggingbutt-0.0.5.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
58ecb382c81005b40a04f11b6a4f8eb12f0137a2afccf31f3788fe3c13d731be
BLAKE2b-256 checksum
How to use checksums
2be31ec3c36440bc5fdb9f42ef42761d73a33b46c4946b63e6188372bf9212f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / huggingbutt-0.0.5-py3-none-any.whl

Download URL huggingbutt-0.0.5-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8980d0d79417dc9ff24d26de7e9173813cc38451e6d4a943b6a051107470720f
BLAKE2b-256 checksum
How to use checksums
a9520a2e52f1e6723a46ed5650543edfb4a7a4588b4338191ead02b1d1f9d464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for huggingbutt 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page