-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: customize model name (for TRTLLM). Allow for empty content chunk…
…s (TRTLLM).
- Loading branch information
Showing
4 changed files
with
44 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
use std::error::Error; | ||
// use vergen_gitcl::{Emitter, GitclBuilder}; | ||
use vergen_gitcl::{Emitter, GitclBuilder}; | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { | ||
// // Try to get the git sha from the local git repository | ||
// let gitcl = GitclBuilder::all_git()?; | ||
// if Emitter::default() | ||
// .fail_on_error() | ||
// .add_instructions(&gitcl)? | ||
// .emit() | ||
// .is_err() | ||
// { | ||
// // Unable to get the git sha | ||
// if let Ok(sha) = std::env::var("GIT_SHA") { | ||
// // Set it from an env var | ||
// println!("cargo:rustc-env=VERGEN_GIT_SHA={sha}"); | ||
// } | ||
// } | ||
// Try to get the git sha from the local git repository | ||
let gitcl = match GitclBuilder::all_git() { | ||
Ok(gitcl) => gitcl, | ||
Err(_) => { | ||
fallback_git_sha(); | ||
return Ok(()); | ||
} | ||
}; | ||
if Emitter::default() | ||
.fail_on_error() | ||
.add_instructions(&gitcl)? | ||
.emit() | ||
.is_err() | ||
{ | ||
fallback_git_sha(); | ||
} | ||
Ok(()) | ||
} | ||
|
||
fn fallback_git_sha() { | ||
// Unable to get the git sha | ||
if let Ok(sha) = std::env::var("GIT_SHA") { | ||
// Set it from an env var | ||
println!("cargo:rustc-env=VERGEN_GIT_SHA={sha}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters