Skip to content

Commit

Permalink
Merge pull request #496 from scala-steward/update/scalafmt-core-3.8.3
Browse files Browse the repository at this point in the history
Update scalafmt-core to 3.8.3
  • Loading branch information
EmergentOrder authored Aug 17, 2024
2 parents dc0e7ad + 9627315 commit 78e4fcf
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ aa0af90da52c49fd157e23ae5e3e148667a17fcd

# Scala Steward: Reformat with scalafmt 3.8.2
394ff5b312131bd5afaa0cfdbefead351f66987c

# Scala Steward: Reformat with scalafmt 3.8.3
8f04588e2bee81f0e6b5df73a0bf636a00090bca
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
align.preset = "more"
maxColumn = 100
version=3.8.2
version=3.8.3
runner.dialect = scala3
indent.main = 3
7 changes: 5 additions & 2 deletions backends/.js/src/main/scala/ORTOperatorBackend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import scala.concurrent.duration._
import org.emergentorder.onnx.onnxruntimeCommon.tensorMod
//import typings.onnxruntimeWeb.tensorMod.Tensor.DataType
//import typings.onnxjs.libTensorMod.Tensor.DataTypeMap.DataTypeMapOps
import org.emergentorder.onnx.onnxruntimeCommon.inferenceSessionImplMod.{InferenceSession => OrtSession}
import org.emergentorder.onnx.onnxruntimeCommon.inferenceSessionImplMod.{
InferenceSession => OrtSession
}
import org.emergentorder.onnx.onnxruntimeCommon.mod.Tensor.{^ => OnnxTensor}
//import typings.onnxruntimeWeb.ort.InferenceSession.{^ => InferenceSess}
//import typings.onnxjs.onnxMod.Onnx
Expand Down Expand Up @@ -347,7 +349,8 @@ trait ORTOperatorBackend extends OpToONNXBytesConverter {
org.emergentorder.onnx.onnxruntimeCommon.inferenceSessionMod.InferenceSession
] = IO.fromFuture {
IO {
val infSess = OrtSession.create("squeezenet1.0-12.onnx", InferenceSession.SessionOptions())
val infSess =
OrtSession.create("squeezenet1.0-12.onnx", InferenceSession.SessionOptions())
Future(
infSess.asInstanceOf[
org.emergentorder.onnx.onnxruntimeCommon.inferenceSessionMod.InferenceSession
Expand Down
63 changes: 38 additions & 25 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lazy val commonSettings = Seq(
resolvers += Resolver.mavenLocal,
resolvers += "Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots",
updateOptions := updateOptions.value.withLatestSnapshots(false),
libraryDependencies += "com.google.protobuf" % "protobuf-java" % "4.27.3",
libraryDependencies += "com.google.protobuf" % "protobuf-java" % "4.27.3",
libraryDependencies += "org.scala-lang" % "scala3-compiler_3" % scalaVersion.value exclude (
"org.scala-sbt",
"compiler-interface"
Expand Down Expand Up @@ -75,7 +75,7 @@ val copyPackageNoExports = taskKey[Unit]("Copy package file without exports to t
lazy val backends = (crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure) in file("backends"))
.dependsOn(core)
.settings(
.settings(
commonSettings,
name := "onnx-scala-backends",
mimaPreviousArtifacts := Set("org.emergent-order" %%% "onnx-scala-backends" % "0.17.0"),
Expand All @@ -102,35 +102,48 @@ lazy val backends = (crossProject(JSPlatform, JVMPlatform)
Compile / npmDependencies += "onnxruntime-common" -> "1.18.0",
Compile / npmDependencies += "typescript" -> "5.4.5",
copyIndexTs := {
import Path._

val src = new File(".")
import Path._

// get the files we want to copy
val htmlFiles: Seq[File] = Seq(new File("index.d.ts"))
val src = new File(".")

// use Path.rebase to pair source files with target destination in crossTarget
val pairs = htmlFiles pair rebase(src, (Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/main/node_modules/onnxruntime-node/dist/types.d.ts")
// get the files we want to copy
val htmlFiles: Seq[File] = Seq(new File("index.d.ts"))

// Copy files to source files to target
IO.copy(pairs, CopyOptions.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false))
// use Path.rebase to pair source files with target destination in crossTarget
val pairs = htmlFiles pair rebase(
src,
(Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/main/node_modules/onnxruntime-node/dist/types.d.ts"
)

},
// Copy files to source files to target
IO.copy(
pairs,
CopyOptions
.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false)
)

},
copyPackageNoExports := {
import Path._

val src = new File(".")

// get the files we want to copy
val htmlFiles: Seq[File] = Seq(new File("package.json"))

// use Path.rebase to pair source files with target destination in crossTarget
val pairs = htmlFiles pair rebase(src, (Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/test/node_modules/onnxruntime-common")

// Copy files to source files to target
IO.copy(pairs, CopyOptions.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false))
},
import Path._

val src = new File(".")

// get the files we want to copy
val htmlFiles: Seq[File] = Seq(new File("package.json"))

// use Path.rebase to pair source files with target destination in crossTarget
val pairs = htmlFiles pair rebase(
src,
(Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/test/node_modules/onnxruntime-common"
)

// Copy files to source files to target
IO.copy(
pairs,
CopyOptions
.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false)
)
},
Compile / compile := (Compile / compile dependsOn (copyIndexTs, copyPackageNoExports)).value,
libraryDependencies += "org.typelevel" %%% "cats-effect-testing-scalatest" % "1.5.0" % Test,
stOutputPackage := "org.emergentorder.onnx",
Expand Down

0 comments on commit 78e4fcf

Please sign in to comment.