From d30652d8048b9d85b252a5f898b0e0b8667ca07e Mon Sep 17 00:00:00 2001 From: Devin Ha Date: Fri, 5 May 2023 11:30:14 +0200 Subject: [PATCH] Fix loadSavedModel for DBFS --- .../scala/com/johnsnowlabs/nlp/util/io/ResourceHelper.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/johnsnowlabs/nlp/util/io/ResourceHelper.scala b/src/main/scala/com/johnsnowlabs/nlp/util/io/ResourceHelper.scala index ebf5087ec17df4..60d2852181af17 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/util/io/ResourceHelper.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/util/io/ResourceHelper.scala @@ -106,7 +106,7 @@ object ResourceHelper { case class SourceStream(resource: String) { var fileSystem: Option[FileSystem] = None - private val (pathExists, path) = OutputHelper.doesPathExists(resource) + private val (pathExists: Boolean, path: Option[Path]) = OutputHelper.doesPathExists(resource) if (!pathExists) { throw new FileNotFoundException(s"file or folder: $resource not found") } else { @@ -156,7 +156,7 @@ object ResourceHelper { Paths.get(destination.toString, path.get.getName).toUri else destination.toUri case "dbfs" => - val dbfsPath = path.toString.replace("dbfs:/", "/dbfs/") + val dbfsPath = path.get.toString.replace("dbfs:/", "/dbfs/") val sourceFile = new File(dbfsPath) val targetFile = new File(destination.toString) if (sourceFile.isFile) FileUtils.copyFileToDirectory(sourceFile, targetFile)