Skip to content

Commit b8a8cb1

Browse files
Merge pull request #13784 from DevinTDHa/bug/dbfs
Fix loadSavedModel for DBFS
2 parents 2153a06 + d30652d commit b8a8cb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/com/johnsnowlabs/nlp/util/io/ResourceHelper.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ object ResourceHelper {
106106
case class SourceStream(resource: String) {
107107

108108
var fileSystem: Option[FileSystem] = None
109-
private val (pathExists, path) = OutputHelper.doesPathExists(resource)
109+
private val (pathExists: Boolean, path: Option[Path]) = OutputHelper.doesPathExists(resource)
110110
if (!pathExists) {
111111
throw new FileNotFoundException(s"file or folder: $resource not found")
112112
} else {
@@ -156,7 +156,7 @@ object ResourceHelper {
156156
Paths.get(destination.toString, path.get.getName).toUri
157157
else destination.toUri
158158
case "dbfs" =>
159-
val dbfsPath = path.toString.replace("dbfs:/", "/dbfs/")
159+
val dbfsPath = path.get.toString.replace("dbfs:/", "/dbfs/")
160160
val sourceFile = new File(dbfsPath)
161161
val targetFile = new File(destination.toString)
162162
if (sourceFile.isFile) FileUtils.copyFileToDirectory(sourceFile, targetFile)

0 commit comments

Comments
 (0)