This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
import numpy as np | |
def setup_code(model_name: str): | |
return f""" | |
import string | |
import random | |
import onnxruntime as _ort | |
from onnxruntime_extensions import get_library_path as _lib_path | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: graviton | |
dependencies: | |
- numpy | |
- pandas | |
- scipy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats.data.NonEmptyList | |
import com.github.plokhotnyuk.jsoniter_scala.core._ | |
import com.github.plokhotnyuk.jsoniter_scala.macros._ | |
object Main extends App { | |
import Sample._ | |
implicit val nelSampleCodec: JsonValueCodec[NonEmptyList[Sample]] = Codecs.make | |
println(readFromArray[NonEmptyList[Sample]]( | |
"""[ | |
| {"id": 0}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.sql.types._ | |
import org.apache.spark.sql.functions._ | |
val f = udf((x: Int) => x, IntegerType) | |
val df = Seq((None), (Some(1))).toDF("value") | |
df.show | |
/* In both Spark versions 2.X and 3.X | |
+-----+ | |
|value| |