Skip to content

Commit 9e83cf2

Browse files
committed
revert
Signed-off-by: Enwei Zhu <21126786+syuoni@users.noreply.github.com>
1 parent 5a758b7 commit 9e83cf2

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

tensorrt_llm/_torch/pyexecutor/grammar_matcher.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
import os
32
from abc import ABC, abstractmethod
43

54
import llguidance
@@ -159,11 +158,7 @@ def create(
159158
grammar = llguidance.LLMatcher.grammar_from_json_schema(
160159
'{"type": "object"}')
161160
case GuidedDecodingParams.GuideType.JSON_SCHEMA:
162-
kwargs = {}
163-
if os.environ.get("TRTLLM_XGUIDANCE_LENIENT") == "1":
164-
kwargs = {"defaults": {"lenient": True}}
165-
grammar = llguidance.LLMatcher.grammar_from_json_schema(
166-
guide, **kwargs)
161+
grammar = llguidance.LLMatcher.grammar_from_json_schema(guide)
167162
case GuidedDecodingParams.GuideType.REGEX:
168163
grammar = llguidance.LLMatcher.grammar_from_regex(guide)
169164
case GuidedDecodingParams.GuideType.EBNF_GRAMMAR:

tensorrt_llm/evaluate/json_mode_eval.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
import json
16+
import os
1617
from typing import Iterable, List, Optional, Union
1718

1819
import click
@@ -56,8 +57,13 @@ def generate_samples(self) -> Iterable[tuple]:
5657
for i, sample in enumerate(self.data):
5758
if i >= self.num_samples:
5859
break
60+
schema = sample["schema"]
61+
if os.environ.get("TRTLLM_XGUIDANCE_LENIENT") == "1":
62+
schema = json.loads(schema)
63+
schema["x-guidance"] = {"lenient": True}
64+
schema = json.dumps(schema)
5965
sampling_args = {
60-
"guided_decoding": GuidedDecodingParams(json=sample["schema"])
66+
"guided_decoding": GuidedDecodingParams(json=schema)
6167
}
6268
yield sample["prompt"], sampling_args, sample["completion"]
6369

tensorrt_llm/llmapi/mpi_session.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ def _start_mpi_pool(self):
167167
assert not self.mpi_pool, 'MPI session already started'
168168

169169
self.mpi_pool = MPIPoolExecutor(max_workers=self.n_workers,
170-
path=sys.path,
171-
env=os.environ)
170+
path=sys.path)
172171

173172
def __del__(self):
174173
self.shutdown_abort()

0 commit comments

Comments
 (0)