Skip to content

Commit

Permalink
update to latest llguidance
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Dec 1, 2024
1 parent a4f0aec commit e6af1bb
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 141 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "toktrie"]
path = toktrie
url = https://github.com/microsoft/toktrie
[submodule "llguidance"]
path = llguidance
url = https://github.com/microsoft/llguidance
Expand Down
120 changes: 4 additions & 116 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ members = [
"trtllm_rs",
"llgtrt",
"llguidance/parser",
"llguidance/sample_parser",
"llguidance/rust",
"toktrie/core",
"toktrie/hf_tokenizers",
"llguidance/toktrie",
"llguidance/toktrie_hf_tokenizers",
"derivre",
]
exclude = [
"llguidance/rust",
"llguidance",
]
resolver = "2"

[profile.release]
# debug = 1

[patch.'https://github.com/microsoft/toktrie']
toktrie = { path = "toktrie/core" }
toktrie_hf_tokenizers = { path = "toktrie/hf_tokenizers" }

[patch.'https://github.com/microsoft/derivre']
derivre = { path = "derivre" }

[workspace.dependencies]
toktrie = { path = "llguidance/toktrie" }
llguidance = { path = "llguidance/parser" }
toktrie_hf_tokenizers = { path = "llguidance/toktrie_hf_tokenizers" }
trtllm_rs = { path = "trtllm_rs" }
8 changes: 4 additions & 4 deletions llgtrt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ clap = { version = "4.4.7", features = ["derive"] }
serde = { version = "1.0.190", features = ["derive"] }
serde_json = "1.0.108"
uuid = { version = "1.6.1", features = ["v4"] }
trtllm_rs = { path = "../trtllm_rs" }
toktrie = { path = "../toktrie/core" }
toktrie_hf_tokenizers = { path = "../toktrie/hf_tokenizers" }
trtllm_rs = { workspace = true }
flexi_logger = "0.29.0"
log = "0.4.22"
rand = "0.8.5"
llguidance_parser = { path = "../llguidance/parser" }
llguidance = { workspace = true }
toktrie = { workspace = true }
toktrie_hf_tokenizers = { workspace = true }
rayon = "1.10.0"
futures-core = "0.3.30"
minijinja = { version = "2.3.1", features = ["preserve_order", "loop_controls", "loader"] }
Expand Down
4 changes: 2 additions & 2 deletions llgtrt/src/async_exec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{ensure, Result};
use llguidance_parser::Constraint;
use llguidance::Constraint;
use rayon::prelude::*;
use std::{
any::Any,
Expand Down Expand Up @@ -127,7 +127,7 @@ impl PendingSeq {
llg.compute_mask()?
} else {
// if we're still in prompt
if !llg.has_current_step_result() {
if llg.step_result().sample_mask.is_none() {
// first time, compute the mask
llg.compute_mask()?
} else {
Expand Down
2 changes: 1 addition & 1 deletion llgtrt/src/constraint_mgr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::routes::api_ext::LlgLogLevel;
use anyhow::Result;
use llguidance_parser::{
use llguidance::{
api::{ParserLimits, TopLevelGrammar},
Constraint, Logger, TokenParser,
};
Expand Down
2 changes: 1 addition & 1 deletion llgtrt/src/routes/api_ext.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use llguidance_parser::api::TopLevelGrammar;
use llguidance::api::TopLevelGrammar;
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};

Expand Down
4 changes: 2 additions & 2 deletions llgtrt/src/routes/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use axum::response::sse::{Event, Sse};
use axum::response::{IntoResponse, Response};
use axum::Json;
use futures_core::Stream;
use llguidance_parser::api::{RegexSpec, TopLevelGrammar};
use llguidance_parser::{lark_to_llguidance, Constraint, GrammarBuilder, JsonCompileOptions};
use llguidance::api::{RegexSpec, TopLevelGrammar};
use llguidance::{lark_to_llguidance, Constraint, GrammarBuilder, JsonCompileOptions};
use serde_json::{json, Value};
use std::fmt::Display;
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion llgtrt/src/routes/openai.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::api_ext::LlgLogLevel;
use llguidance_parser::api::TopLevelGrammar;
use llguidance::api::TopLevelGrammar;
use serde::{Deserialize, Deserializer, Serialize};
use std::collections::HashMap;
use toktrie::{TokTrie, TokenId};
Expand Down
2 changes: 1 addition & 1 deletion llguidance
1 change: 0 additions & 1 deletion toktrie
Submodule toktrie deleted from 148399

0 comments on commit e6af1bb

Please sign in to comment.