Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/AI' into AI
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliot McIntire committed Jan 10, 2025
2 parents 05f337f + b42bf33 commit 65343b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions R/GPT2.R
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ get_function_defaults <- function(func) {
# Helper function to reorder arguments based on formal arguments, combining defaults and user args
reorder_arguments <- function(formals, args) {
# Combine defaults and args: user args override defaults
combined_args <- modifyList(formals, args)
combined_args <- modifyList(formals, args, keep.null = TRUE)

# Preserve the order of the formals
ordered_args <- combined_args[union(names(formals), names(combined_args))]
Expand Down Expand Up @@ -1099,7 +1099,6 @@ loadFromDiskOrMemoise <- function(fromMemoise = FALSE, useCache,
memoiseFail <- TRUE
rm(list = cache_key, envir = memoiseEnv(cachePath))
cache_file <- CacheStoredFile(cachePath, cache_key)
browser()
}
}
if (!fromMemoise || rerun || memoiseFail) {
Expand Down
3 changes: 2 additions & 1 deletion R/exportedMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -1173,10 +1173,11 @@ unmakeMemoisable.default <- function(x) {
obj <- unwrapRaster(obj, cachePath, cacheId)
} else {
obj <- lapply(obj, function(out) {
ret <- .unwrap(out, cachePath, cacheId, drv, conn, ...)
ret <- .unwrap(out, cachePath, cacheId = cacheId, drv, conn, ...)
if (is.character(ret))
if (identical(.returnNothing, ret))
FAIL <<- TRUE
ret
})
}
}
Expand Down
5 changes: 3 additions & 2 deletions R/showCacheEtc.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ setMethod(
createCache(x, drv = drv, force = TRUE)
# }
if (isTRUE(getOption("reproducible.useMemoise"))) {
if (exists(x, envir = .pkgEnv)) {
rm(list = x, envir = .pkgEnv)
objsInMemEnv <- ls(memoiseEnv(x))
if (length(objsInMemEnv)) {
rm(list = objsInMemEnv, envir = memoiseEnv(x))
}
}
# memoise::forget(.loadFromLocalRepoMem)
Expand Down

0 comments on commit 65343b6

Please sign in to comment.