Instructions to use jonl521/modeling_simple with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jonl521/modeling_simple with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("jonl521/modeling_simple", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download .venv/lib/python3.14/site-packages/torch/include/pybind11/warnings.h from jonl521/modeling_simple: direct link, hf CLI and curl.
- Browser
- Download file 2.37 kB
-
https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/torch/include/pybind11/warnings.h
- Command line
-
hf download hf://jonl521/modeling_simple/.venv/lib/python3.14/site-packages/torch/include/pybind11/warnings.h
-
curl -L -o warnings.h https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/torch/include/pybind11/warnings.h
2.37 kB
| /* | |
| pybind11/warnings.h: Python warnings wrappers. | |
| Copyright (c) 2024 Jan Iwaszkiewicz <jiwaszkiewicz6@gmail.com> | |
| All rights reserved. Use of this source code is governed by a | |
| BSD-style license that can be found in the LICENSE file. | |
| */ | |
| PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) | |
| PYBIND11_NAMESPACE_BEGIN(detail) | |
| inline bool PyWarning_Check(PyObject *obj) { | |
| int result = PyObject_IsSubclass(obj, PyExc_Warning); | |
| if (result == 1) { | |
| return true; | |
| } | |
| if (result == -1) { | |
| raise_from(PyExc_SystemError, | |
| "pybind11::detail::PyWarning_Check(): PyObject_IsSubclass() call failed."); | |
| throw error_already_set(); | |
| } | |
| return false; | |
| } | |
| PYBIND11_NAMESPACE_END(detail) | |
| PYBIND11_NAMESPACE_BEGIN(warnings) | |
| inline object | |
| new_warning_type(handle scope, const char *name, handle base = PyExc_RuntimeWarning) { | |
| if (!detail::PyWarning_Check(base.ptr())) { | |
| pybind11_fail("pybind11::warnings::new_warning_type(): cannot create custom warning, base " | |
| "must be a subclass of " | |
| "PyExc_Warning!"); | |
| } | |
| if (hasattr(scope, name)) { | |
| pybind11_fail("pybind11::warnings::new_warning_type(): an attribute with name \"" | |
| + std::string(name) + "\" exists already."); | |
| } | |
| std::string full_name = scope.attr("__name__").cast<std::string>() + std::string(".") + name; | |
| handle h(PyErr_NewException(full_name.c_str(), base.ptr(), nullptr)); | |
| if (!h) { | |
| raise_from(PyExc_SystemError, | |
| "pybind11::warnings::new_warning_type(): PyErr_NewException() call failed."); | |
| throw error_already_set(); | |
| } | |
| auto obj = reinterpret_steal<object>(h); | |
| scope.attr(name) = obj; | |
| return obj; | |
| } | |
| // Similar to Python `warnings.warn()` | |
| inline void | |
| warn(const char *message, handle category = PyExc_RuntimeWarning, int stack_level = 2) { | |
| if (!detail::PyWarning_Check(category.ptr())) { | |
| pybind11_fail( | |
| "pybind11::warnings::warn(): cannot raise warning, category must be a subclass of " | |
| "PyExc_Warning!"); | |
| } | |
| if (PyErr_WarnEx(category.ptr(), message, stack_level) == -1) { | |
| throw error_already_set(); | |
| } | |
| } | |
| PYBIND11_NAMESPACE_END(warnings) | |
| PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) | |