mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
use Draft202012
This commit is contained in:
parent
2251f5b16f
commit
0533e67ea6
@ -22,7 +22,7 @@ text-generation-client = { path = "client" }
|
||||
clap = { version = "4.4.5", features = ["derive", "env"] }
|
||||
futures = "0.3.28"
|
||||
hf-hub = { version = "0.3.0", features = ["tokio"] }
|
||||
jsonschema = "0.17.1"
|
||||
jsonschema = { version = "0.17.1", features = ["draft202012"] }
|
||||
metrics = "0.21.1"
|
||||
metrics-exporter-prometheus = { version = "0.12.1", features = [] }
|
||||
nohash-hasher = "0.2.0"
|
||||
|
@ -46,7 +46,7 @@ impl HubTokenizerConfig {
|
||||
}
|
||||
|
||||
mod json_object_or_string_to_string {
|
||||
use jsonschema::JSONSchema;
|
||||
use jsonschema::{Draft, JSONSchema};
|
||||
use serde::{Deserialize, Deserializer};
|
||||
use serde_json::Value;
|
||||
|
||||
@ -59,6 +59,7 @@ mod json_object_or_string_to_string {
|
||||
let value = Value::deserialize(deserializer)?;
|
||||
|
||||
JSONSchema::options()
|
||||
.with_draft(Draft::Draft202012)
|
||||
.compile(&value)
|
||||
.map_err(|e| serde::de::Error::custom(format!("invalid JSONSchema: {e}")))?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user