Coder Social home page Coder Social logo

barahlush / vastai_client Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 5.0 430 KB

This package provides a Python client for the Vast.ai GPU rent service, that allows to list, create, destroy GPU instances programmaticaly, using Python.

License: MIT License

Makefile 0.85% Python 99.15%
gpu hosting python rent vast vast-ai

vastai_client's People

Contributors

barahlush avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

vastai_client's Issues

Both the parsers in `vast_utils.py` are broken.

I'm trying to figure out how the parse_env() function works. So far, it seems like it doesn't work for anything:

from vastai_client.vast_utils import parse_env
env_strs = [
"'-e INTERRO_USER=mlbox_2'",
"'-e ASR_MODEL=base'",
]


for env_str in env_strs:
	ret = parse_env(env_str)

	print("Env: %s -> '%s'" % (env_str, ret))

returns:

Env: '-e INTERRO_USER=mlbox_2' -> '{}'
Env: '-e ASR_MODEL=base' -> '{}'

The ASR_MODEL example string is literally from the docstring of the function. Nothing I do seems to ever cause it to return anything but an empty dict.

Typererror

File "C:\Users\asus\Desktop\vast.py", line 1, in
from vastai_client import VastClient
File "C:\Users\asus\AppData\Local\Programs\Python\Python39\lib\site-packages\vastai_client_init_.py", line 1, in
from .vast_client import VastClient
File "C:\Users\asus\AppData\Local\Programs\Python\Python39\lib\site-packages\vastai_client\vast_client.py", line 15, in
from vastai_client.models import Instance, Machine, QueryType
File "C:\Users\asus\AppData\Local\Programs\Python\Python39\lib\site-packages\vastai_client\models.py", line 3, in
QueryType = dict[str, bool | str | list[list[str]] | dict[str, str | bool]]
TypeError: unsupported operand type(s) for |: 'type' and 'type'

What is causing this?How to fix it?
iss

Exception in get_instances method

Module version: 0.1.1

Traceback :

Traceback (most recent call last):
  File "test.py", line 5, in <module>
    print(client.get_instances())
          ^^^^^^^^^^^^^^^^^^^^^^
  File "venv\Lib\site-packages\vastai_client\vast_client.py", line 270, in get_instances
    return [from_dict(data_class=Instance, data=row) for row in rows]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "venv\Lib\site-packages\vastai_client\vast_client.py", line 270, in <listcomp>
    return [from_dict(data_class=Instance, data=row) for row in rows]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "venv\Lib\site-packages\dacite\core.py", line 69, in from_dict
    raise WrongTypeError(field_path=field.name, field_type=field_type, value=value)
dacite.exceptions.WrongTypeError: wrong value type for field "disk_util" - should be "int | None" instead of value "0.36800000071525574" of type "float"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.