Unverified Commit b4fe248b authored by Nicolas Patry's avatar Nicolas Patry Committed by GitHub
Browse files

fix(launcher): handle hub branches (#278)

parent b67908e0
...@@ -258,9 +258,10 @@ fn init_logging(otlp_endpoint: Option<String>, json_output: bool) { ...@@ -258,9 +258,10 @@ fn init_logging(otlp_endpoint: Option<String>, json_output: bool) {
/// get model info from the Huggingface Hub /// get model info from the Huggingface Hub
pub async fn get_model_info(model_id: &str, revision: &str, token: Option<String>) -> HubModelInfo { pub async fn get_model_info(model_id: &str, revision: &str, token: Option<String>) -> HubModelInfo {
let client = reqwest::Client::new(); let client = reqwest::Client::new();
let mut builder = client.get(format!( // Poor man's urlencode
"https://huggingface.co/api/models/{model_id}/revision/{revision}" let revision = revision.replace("/", "%2F");
)); let url = format!("https://huggingface.co/api/models/{model_id}/revision/{revision}");
let mut builder = client.get(url);
if let Some(token) = token { if let Some(token) = token {
builder = builder.bearer_auth(token); builder = builder.bearer_auth(token);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment