Skip to content

Commit

Permalink
remove rust bindings for now (#812)
Browse files Browse the repository at this point in the history
Remove the rust bindings for now since they make development and
releasing more complicated.
  • Loading branch information
paulbkoch authored May 10, 2024
1 parent 5ad2304 commit 56ab69e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
5 changes: 0 additions & 5 deletions guidance/models/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
"Failed to load guidance.cpp, falling back to Python mirror implementations..."
)
from .. import _cpp as cpp

from ._guidance_engine_metrics import GuidanceEngineMetrics
from .._rust.guidancerust import engine_start
from .._utils import softmax, CaptureEvents
from .._parser import EarleyCommitParser, Parser
from .._grammar import (
Expand Down Expand Up @@ -741,9 +739,6 @@ def __call__(self, parser, grammar, ensure_bos_token=True):

self.start(parser, grammar, ensure_bos_token)

# TODO: remove this after the next release. This verifies that calling Rust works.
assert("def" == engine_start("abc", "def", 1))

logits = None
while True:
is_done, logits_state, response_state = self.next(logits)
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ requires = [
"setuptools>=42",
"wheel",
"pybind11>=2.10.0",
"setuptools-rust",
]
build-backend = "setuptools.build_meta"

Expand Down
8 changes: 0 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import codecs
from setuptools import setup, find_packages
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools_rust import Binding, RustExtension

here = os.path.abspath(os.path.dirname(__file__))

Expand Down Expand Up @@ -91,13 +90,6 @@ def find_version(*file_paths):
"guidance.cpp", ["guidance/_cpp/main.cpp", "guidance/_cpp/byte_trie.cpp"]
)
],
rust_extensions=[
RustExtension(
"guidance._rust.guidancerust",
"guidance/_rust/Cargo.toml",
binding=Binding.PyO3,
)
],
cmdclass={"build_ext": build_ext},
python_requires=">=3.8",
install_requires=install_requires,
Expand Down

0 comments on commit 56ab69e

Please sign in to comment.