Skip to content

Instantly share code, notes, and snippets.

View SteffenDE's full-sized avatar
🏠
Working from home

Steffen Deusch SteffenDE

🏠
Working from home
View GitHub Profile
@SteffenDE
SteffenDE / ortex_mpnet.livemd
Created July 25, 2023 16:05
Running the all-mpnet-base-v2 sentence transformer in Elixir using Ortex

Ortex MPNet Sentence Transformer

Mix.install([
  {:ortex, github: "elixir-nx/ortex", ref: "9e384971d1904ba91e5bfa49594d742a1d06cb4c"},
  {:tokenizers,
   github: "elixir-nx/tokenizers", override: true, ref: "20295cfdf9b6342d723b405481791ec87afa203c"},
  {:exla,
   github: "elixir-nx/nx",
   sparse: "exla",

Ortex Sentence Transformer

Mix.install([
  {:ortex, github: "elixir-nx/ortex", ref: "9e384971d1904ba91e5bfa49594d742a1d06cb4c"},
  {:tokenizers,
   github: "elixir-nx/tokenizers", override: true, ref: "20295cfdf9b6342d723b405481791ec87afa203c"},
  {:exla,
   github: "elixir-nx/nx",
   sparse: "exla",
$ elixir wtf.exs
2023-07-06 15:18:41.441580: I tensorflow/core/util/port.cc:104] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
15:18:43.953 [info] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
15:18:43.953 [info] XLA service 0x7f794042a100 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
15:18:43.953 [info] StreamExecutor device (0): Tesla T4, Compute Capability 7.5
15:18:43.953 [info] Using BFC allocator.

Sentence Transformer Benchmark

Mix.install([
  {:bumblebee, github: "elixir-nx/bumblebee", ref: "23de64b1b88ed3aad266025c207f255312b80ba6"},
  {:nx, github: "elixir-nx/nx", sparse: "nx", override: true},
  {:exla, github: "elixir-nx/nx", sparse: "exla", override: true},
  {:axon, "~> 0.5.1"},
{
"id": "displayset_1587045085669",
"name": "Example Displayset",
"layout": {
"children": [
{
"children": [
{
"interval": null,
"reload": 360,
@SteffenDE
SteffenDE / sandbox.livemd
Last active August 13, 2022 12:23
Phoenix.Ecto.SQL.Sandbox + Tasks

Phoenix.Ecto.SQL.Sandbox + Tasks

Mix.install([
  {:ecto_sql, "~> 3.8.0"},
  {:ecto_sqlite3, "~> 0.8.0"},
  {:phoenix, "~> 1.6.11"},
  {:phoenix_live_view, "~> 0.17.11"},
  {:phoenix_ecto, "~> 4.4"},
  {:jason, "~> 1.3"},

AoC Day 15 - Chiton

Setup

Mix.install([:kino])
input = Kino.Input.textarea("Please input data:")

AoC Day 14 - Extended Polymerization

Section

Mix.install([:kino])
input = Kino.Input.textarea("Please input data:")

AoC Day 13 - Transparent Origami

Setup

Mix.install([:kino, :vega_lite])
input = Kino.Input.textarea("Please input data:")

AoC Day 12 - Passage Pathing

Setup

Mix.install([:kino])
input = Kino.Input.textarea("Please input data:")