Skip to content

Commit

Permalink
Fix unauth check (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
EricLBuehler authored May 30, 2024
1 parent d5c5a09 commit e9ee6ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mistralrs-core/src/pipeline/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ macro_rules! api_dir_list {
if let hf_hub::api::sync::ApiError::RequestError(resp) = e {
let resp = resp.into_response();
// If it's 401, assume that we're running locally only.
if resp.as_ref().is_some_and(|r| r.status() != 401) {
if resp.as_ref().is_some_and(|r| r.status() == 401) {
unauth = true;
} else if resp.as_ref().is_some_and(|r| r.status() != 404) {
panic!("{format}");
Expand Down Expand Up @@ -54,7 +54,7 @@ macro_rules! api_get_file {
if let hf_hub::api::sync::ApiError::RequestError(resp) = e {
let resp = resp.into_response();
// If it's 401, assume that we're running locally only.
if resp.as_ref().is_some_and(|r| r.status() != 401) {
if resp.as_ref().is_some_and(|r| r.status() == 401) {
unauth = true;
} else if resp.as_ref().is_some_and(|r| r.status() != 404) {
panic!("{format}");
Expand Down

0 comments on commit e9ee6ed

Please sign in to comment.