mirror of
https://github.com/huggingface/candle.git
synced 2025-06-22 20:38:06 +00:00
Tmp.
This commit is contained in:
@ -53,7 +53,11 @@ impl Cache {
|
||||
let commit_hash = std::fs::read_to_string(commit_path).ok()?;
|
||||
let mut pointer_path = self.pointer_path(repo, &commit_hash);
|
||||
pointer_path.push(filename);
|
||||
Some(pointer_path)
|
||||
if pointer_path.exists(){
|
||||
Some(pointer_path)
|
||||
}else{
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a reference in the cache directory that points branches to the correct
|
||||
@ -146,7 +150,12 @@ impl Repo {
|
||||
|
||||
/// The normalized folder nameof the repo within the cache directory
|
||||
pub fn folder_name(&self) -> String {
|
||||
self.repo_id.replace('/', "--")
|
||||
let prefix = match self.repo_type{
|
||||
RepoType::Model => "models",
|
||||
RepoType::Dataset => "datasets",
|
||||
RepoType::Space => "spaces",
|
||||
};
|
||||
format!("{prefix}--{}", self.repo_id).replace('/', "--")
|
||||
}
|
||||
|
||||
/// The revision
|
||||
|
Reference in New Issue
Block a user