GithubHelp home page GithubHelp logo

unifyai / models Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 31.0 245.95 MB

Off-the-shelf models for a variety of domains

Home Page: https://unify.ai

License: Apache License 2.0

Dockerfile 0.59% Python 99.34% Shell 0.07%

models's People

Contributors

aarsh2001 avatar abdulasiraj avatar bicycleman15 avatar bipinkrishnan avatar catb1t avatar djl11 avatar haidersultanarc avatar hello-fri-end avatar ivy-branch avatar juliagsy avatar kareemmax avatar kurshakuz avatar madjid-ch avatar mahmoudashraf97 avatar mattbarrett98 avatar mobley-trent avatar modanesh avatar mohame54 avatar mosesdaudu001 avatar muhammedashraf2020 avatar rashulchutani avatar rishabgit avatar ritujapawas avatar rush2406 avatar sarvesh-kesharwani avatar selvaraj-sembulingam avatar shireenchand avatar tomatillos avatar vedpatwardhan avatar zaeemansari70 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

models's Issues

Error with serializing configs of efficientnet while pushing model to HF

model_name = "efficientnet_b0"
โ€‹
imported_model1.push_to_huggingface(
repo_id=f"unifyai/{model_name}",
config_path = "config.json",
model_path = "model.pkl",
weights_path = "weights.hdf5",
repo_type = "model",
token = "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",
private = False,
revision = None,
commit_message = "adds {model_name} model",
commit_description = "Adding {model_name} model, config(specs), and weights",
create_pr= False,
safe_serialization = False,
push_config = True,
push_model = True,
push_weights = True,
)

Pushing config to Hugging Face...

TypeError Traceback (most recent call last)
Cell In[19], line 3
1 model_name = "efficientnet_b0"
----> 3 imported_model1.push_to_huggingface(
4 repo_id=f"unifyai/{model_name}",
5 config_path = "config.json",
6 model_path = "model.pkl",
7 weights_path = "weights.hdf5",
8 repo_type = "model",
9 token = "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",
10 private = False,
11 revision = None,
12 commit_message = "adds {model_name} model",
13 commit_description = "Adding {model_name} model, config(specs), and weights",
14 create_pr= False,
15 safe_serialization = False,
16 push_config = True,
17 push_model = True,
18 push_weights = True,
19 )

File /opt/conda/lib/python3.10/site-packages/ivy_models/base/model.py:72, in BaseModel.push_to_huggingface(self, repo_id, config_path, model_path, weights_path, repo_type, token, private, revision, commit_message, commit_description, create_pr, safe_serialization, push_config, push_model, push_weights)
70 if push_config:
71 print("Pushing config to Hugging Face...")
---> 72 self.spec.to_json_file()
73 api.upload_file(
74 path_or_fileobj=config_path,
75 repo_id=repo_id,
76 path_in_repo=config_path,
77 repo_type=repo_type,
78 )
79 os.remove(config_path)

File /opt/conda/lib/python3.10/site-packages/ivy_models/base/spec.py:77, in BaseSpec.to_json_file(self, save_directory)
75 os.makedirs(save_directory, exist_ok=True)
76 with open(os.path.join(save_directory, "config.json"), "w") as f:
---> 77 json.dump(self.dict, f)
78 print("Saved to directory:", save_directory)

File /opt/conda/lib/python3.10/json/init.py:179, in dump(obj, fp, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
173 iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii,
174 check_circular=check_circular, allow_nan=allow_nan, indent=indent,
175 separators=separators,
176 default=default, sort_keys=sort_keys, **kw).iterencode(obj)
177 # could accelerate with writelines in some versions of Python, at
178 # a debuggability cost
--> 179 for chunk in iterable:
180 fp.write(chunk)

File /opt/conda/lib/python3.10/json/encoder.py:431, in _make_iterencode.._iterencode(o, _current_indent_level)
429 yield from _iterencode_list(o, _current_indent_level)
430 elif isinstance(o, dict):
--> 431 yield from _iterencode_dict(o, _current_indent_level)
432 else:
433 if markers is not None:

File /opt/conda/lib/python3.10/json/encoder.py:405, in _make_iterencode.._iterencode_dict(dct, _current_indent_level)
403 else:
404 chunks = _iterencode(value, _current_indent_level)
--> 405 yield from chunks
406 if newline_indent is not None:
407 _current_indent_level -= 1

File /opt/conda/lib/python3.10/json/encoder.py:325, in _make_iterencode.._iterencode_list(lst, _current_indent_level)
323 else:
324 chunks = _iterencode(value, _current_indent_level)
--> 325 yield from chunks
326 if newline_indent is not None:
327 _current_indent_level -= 1

File /opt/conda/lib/python3.10/json/encoder.py:438, in _make_iterencode.._iterencode(o, _current_indent_level)
436 raise ValueError("Circular reference detected")
437 markers[markerid] = o
--> 438 o = _default(o)
439 yield from _iterencode(o, _current_indent_level)
440 if markers is not None:

File /opt/conda/lib/python3.10/json/encoder.py:179, in JSONEncoder.default(self, o)
160 def default(self, o):
161 """Implement this method in a subclass such that it returns
162 a serializable object for o, or calls the base implementation
163 (to raise a TypeError).
(...)
177
178 """
--> 179 raise TypeError(f'Object of type {o.class.name} '
180 f'is not JSON serializable')

TypeError: Object of type MBConvConfig is not JSON serializable

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.