From 56ab69e022a678db382c7ae638d760848f57d7b5 Mon Sep 17 00:00:00 2001 From: Paul Koch <46825734+paulbkoch@users.noreply.github.com> Date: Thu, 9 May 2024 18:01:12 -0700 Subject: [PATCH] remove rust bindings for now (#812) Remove the rust bindings for now since they make development and releasing more complicated. --- guidance/models/_model.py | 5 ----- pyproject.toml | 1 - setup.py | 8 -------- 3 files changed, 14 deletions(-) diff --git a/guidance/models/_model.py b/guidance/models/_model.py index fdabaf80e..cd5cfa296 100644 --- a/guidance/models/_model.py +++ b/guidance/models/_model.py @@ -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 ( @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 252822b69..84779e1d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,6 @@ requires = [ "setuptools>=42", "wheel", "pybind11>=2.10.0", - "setuptools-rust", ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 7e3edf224..cd4c21c8f 100644 --- a/setup.py +++ b/setup.py @@ -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__)) @@ -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,