Skip to content

Commit

Permalink
updated setup_modules and add setup_gpu_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexChristensen committed Feb 3, 2024
1 parent 9f48ca5 commit eab84a6
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export(nlp_scores)
export(plot_sim_emotions)
export(punctuate)
export(rag)
export(setup_gpu_modules)
export(setup_miniconda)
export(setup_modules)
export(simulate_video)
export(transformer_scores)
export(video_scores)
Expand Down
40 changes: 40 additions & 0 deletions R/setup_gpu_modules.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#' Install GPU Python Modules
#'
#' @description Installs GPU modules for the {transforEmotion} conda environment
#'
#' @details Installs modules for miniconda using \code{\link[reticulate]{conda_install}}
#'
#' @author Alexander P. Christensen <alexpaulchristensen@gmail.com>
#'
#' @export
#'
# Install GPU modules
# Updated 03.02.2024
setup_gpu_modules <- function()
{

# Set necessary modules
modules <- c(
"autoawq"
)

# Determine whether any modules need to be installed
installed_modules <- reticulate::py_list_packages(envname = "transforEmotion")

# Determine missing modules
missing_modules <- modules[!modules %in% installed_modules$package]

# Determine if modules need to be installed
if(length(missing_modules) != 0){

# Send message to user
message("\nInstalling modules for 'transforEmotion'...")

# Install modules
reticulate::conda_install(
"transforEmotion", packages = missing_modules, pip = TRUE
)

}

}
8 changes: 4 additions & 4 deletions R/setup_modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
#'
#' @author Alexander P. Christensen <alexpaulchristensen@gmail.com>
#'
#' @noRd
#' @export
#'
# Install modules
# Updated 28.01.2024
# Updated 03.02.2024
setup_modules <- function()
{

# Set necessary modules
modules <- c(
"accelerate", "autoawq", "llama-index", "nltk",
"accelerate", "llama-index", "nltk",
"opencv-python", "pandas", "pypdf",
"pytube", "pytz", "qdrant-client",
"sentencepiece", "tensorflow", "torch",
"sentencepiece", "tensorflow", "torch",
"torchaudio", "torchvision", "transformers"
)

Expand Down
17 changes: 17 additions & 0 deletions man/setup_gpu_modules.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions man/setup_modules.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eab84a6

Please sign in to comment.