Alex Cabrera commited on
Commit
5dbce8b
1 Parent(s): e836fc3
.zeno_cache/OUTPUTStable Diffusion.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7dae3bfa1cc6f8430415a422c96a48866c8bd7ef3e849e193349bd9b29f15c8
3
+ size 106025883
.zeno_cache/PREDISTILLlength.pickle CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4ffa123a5017b310990a9b70ad99c59c87ad2d6b725b02d0231397baae94d76a
3
- size 100459948
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4df3b80eda5266afa2f990fb20fc79a754d0a5ef766c8f25df19542a018a3b7d
3
+ size 100459898
.zeno_cache/folders.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec0a6ccf9debf1c16781445c4b9106080d00478b0559469336db7c7b7b9711c8
3
+ size 5
.zeno_cache/reports.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a848f603456d7c6c08a6072a4d67f7bafe742b9a670496c51e06883f12943058
3
+ size 1625
.zeno_cache/slices.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4749f80758f2a5d004c27f8aadbbb0d6aaf286f338c2a5e0f4f726d9cb3bbf90
3
+ size 801
.zeno_cache/view.mjs CHANGED
@@ -533,7 +533,7 @@ function add_css(target) {
533
  append_styles(target, "svelte-8lajst", ".label.svelte-8lajst{margin-right:5px;font-size:10px;color:rgba(0, 0, 0, 0.5);font-variant:small-caps}.text.svelte-8lajst{display:flex;flex-direction:row}.value.svelte-8lajst{font-size:10px}.box.svelte-8lajst{width:min-content;padding:5px;border:0.5px solid rgb(224, 224, 224)}");
534
  }
535
 
536
- // (22:2) {#if modelColumn && entry[modelColumn]}
537
  function create_if_block(ctx) {
538
  let div;
539
  let span0;
@@ -650,7 +650,7 @@ function create_fragment(ctx) {
650
  this.h();
651
  },
652
  h() {
653
- if (!src_url_equal(img.src, img_src_value = "" + (/*dataOrigin*/ ctx[3] + /*entry*/ ctx[0][/*idColumn*/ ctx[4]]))) attr(img, "src", img_src_value);
654
  attr(img, "alt", img_alt_value = "Image thumbnail for instance " + /*entry*/ ctx[0][/*idColumn*/ ctx[4]]);
655
  set_style(img, "max-width", `200px`, false);
656
  attr(span0, "class", "label svelte-8lajst");
@@ -675,7 +675,7 @@ function create_fragment(ctx) {
675
  if (if_block) if_block.m(div1, null);
676
  },
677
  p(ctx, [dirty]) {
678
- if (dirty & /*dataOrigin, entry, idColumn*/ 25 && !src_url_equal(img.src, img_src_value = "" + (/*dataOrigin*/ ctx[3] + /*entry*/ ctx[0][/*idColumn*/ ctx[4]]))) {
679
  attr(img, "src", img_src_value);
680
  }
681
 
@@ -713,7 +713,6 @@ function instance($$self, $$props, $$invalidate) {
713
  let { modelColumn } = $$props;
714
  let { labelColumn } = $$props;
715
  let { dataColumn } = $$props;
716
- let { dataOrigin } = $$props;
717
  let { idColumn } = $$props;
718
 
719
  $$self.$$set = $$props => {
@@ -721,12 +720,11 @@ function instance($$self, $$props, $$invalidate) {
721
  if ('options' in $$props) $$invalidate(5, options = $$props.options);
722
  if ('modelColumn' in $$props) $$invalidate(1, modelColumn = $$props.modelColumn);
723
  if ('labelColumn' in $$props) $$invalidate(2, labelColumn = $$props.labelColumn);
724
- if ('dataColumn' in $$props) $$invalidate(6, dataColumn = $$props.dataColumn);
725
- if ('dataOrigin' in $$props) $$invalidate(3, dataOrigin = $$props.dataOrigin);
726
  if ('idColumn' in $$props) $$invalidate(4, idColumn = $$props.idColumn);
727
  };
728
 
729
- return [entry, modelColumn, labelColumn, dataOrigin, idColumn, options, dataColumn];
730
  }
731
 
732
  class InstanceView extends SvelteComponent {
@@ -744,8 +742,7 @@ class InstanceView extends SvelteComponent {
744
  options: 5,
745
  modelColumn: 1,
746
  labelColumn: 2,
747
- dataColumn: 6,
748
- dataOrigin: 3,
749
  idColumn: 4
750
  },
751
  add_css
@@ -760,7 +757,6 @@ function getInstance(
760
  modelColumn,
761
  labelColumn,
762
  dataColumn,
763
- dataOrigin,
764
  idColumn
765
  ) {
766
  new InstanceView({
@@ -771,7 +767,6 @@ function getInstance(
771
  modelColumn: modelColumn,
772
  labelColumn: labelColumn,
773
  dataColumn: dataColumn,
774
- dataOrigin: dataOrigin,
775
  idColumn: idColumn,
776
  },
777
  hydrate: true,
 
533
  append_styles(target, "svelte-8lajst", ".label.svelte-8lajst{margin-right:5px;font-size:10px;color:rgba(0, 0, 0, 0.5);font-variant:small-caps}.text.svelte-8lajst{display:flex;flex-direction:row}.value.svelte-8lajst{font-size:10px}.box.svelte-8lajst{width:min-content;padding:5px;border:0.5px solid rgb(224, 224, 224)}");
534
  }
535
 
536
+ // (21:2) {#if modelColumn && entry[modelColumn]}
537
  function create_if_block(ctx) {
538
  let div;
539
  let span0;
 
650
  this.h();
651
  },
652
  h() {
653
+ if (!src_url_equal(img.src, img_src_value = /*entry*/ ctx[0][/*dataColumn*/ ctx[3]])) attr(img, "src", img_src_value);
654
  attr(img, "alt", img_alt_value = "Image thumbnail for instance " + /*entry*/ ctx[0][/*idColumn*/ ctx[4]]);
655
  set_style(img, "max-width", `200px`, false);
656
  attr(span0, "class", "label svelte-8lajst");
 
675
  if (if_block) if_block.m(div1, null);
676
  },
677
  p(ctx, [dirty]) {
678
+ if (dirty & /*entry, dataColumn*/ 9 && !src_url_equal(img.src, img_src_value = /*entry*/ ctx[0][/*dataColumn*/ ctx[3]])) {
679
  attr(img, "src", img_src_value);
680
  }
681
 
 
713
  let { modelColumn } = $$props;
714
  let { labelColumn } = $$props;
715
  let { dataColumn } = $$props;
 
716
  let { idColumn } = $$props;
717
 
718
  $$self.$$set = $$props => {
 
720
  if ('options' in $$props) $$invalidate(5, options = $$props.options);
721
  if ('modelColumn' in $$props) $$invalidate(1, modelColumn = $$props.modelColumn);
722
  if ('labelColumn' in $$props) $$invalidate(2, labelColumn = $$props.labelColumn);
723
+ if ('dataColumn' in $$props) $$invalidate(3, dataColumn = $$props.dataColumn);
 
724
  if ('idColumn' in $$props) $$invalidate(4, idColumn = $$props.idColumn);
725
  };
726
 
727
+ return [entry, modelColumn, labelColumn, dataColumn, idColumn, options];
728
  }
729
 
730
  class InstanceView extends SvelteComponent {
 
742
  options: 5,
743
  modelColumn: 1,
744
  labelColumn: 2,
745
+ dataColumn: 3,
 
746
  idColumn: 4
747
  },
748
  add_css
 
757
  modelColumn,
758
  labelColumn,
759
  dataColumn,
 
760
  idColumn
761
  ) {
762
  new InstanceView({
 
767
  modelColumn: modelColumn,
768
  labelColumn: labelColumn,
769
  dataColumn: dataColumn,
 
770
  idColumn: idColumn,
771
  },
772
  hydrate: true,
__pycache__/functions.cpython-38.pyc ADDED
Binary file (1.19 kB). View file
 
config.toml CHANGED
@@ -1,11 +1,17 @@
1
  functions = "./"
2
  view = "image-classification"
3
  metadata = "./metadata_f.parquet"
 
4
  data_path = "https://diffusiondb.m4ke.org/"
5
  data_column = "image_name"
 
6
  label_column = "prompt"
7
  batch_size = 100000
8
- port = 7860
 
 
9
  host = "0.0.0.0"
10
  editable = false
11
- calculate_histogram_metrics = false
 
 
 
1
  functions = "./"
2
  view = "image-classification"
3
  metadata = "./metadata_f.parquet"
4
+ models = ["Stable Diffusion"]
5
  data_path = "https://diffusiondb.m4ke.org/"
6
  data_column = "image_name"
7
+ id_column = "image_name"
8
  label_column = "prompt"
9
  batch_size = 100000
10
+ calculate_histogram_metrics = false
11
+ port = 7860
12
+
13
  host = "0.0.0.0"
14
  editable = false
15
+
16
+ # host = "localhost"
17
+ # editable = true
functions.py CHANGED
@@ -1,17 +1,34 @@
1
- from zeno import distill, metric, ZenoOptions
2
  from pandas import DataFrame
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  @distill
6
  def length(df: DataFrame, ops: ZenoOptions):
7
- return df["prompt"].str.len()
8
 
9
 
10
  @metric
11
  def avg_image_nswf(df: DataFrame, ops: ZenoOptions):
12
- return float(df["image_nsfw"].dropna().mean())
13
 
14
 
15
  @metric
16
  def avg_prompt_nsfw(df: DataFrame, ops: ZenoOptions):
17
- return float(df["prompt_nsfw"].dropna().mean())
 
 
1
  from pandas import DataFrame
2
 
3
+ from zeno import (
4
+ DistillReturn,
5
+ MetricReturn,
6
+ ModelReturn,
7
+ ZenoOptions,
8
+ distill,
9
+ metric,
10
+ model,
11
+ )
12
+
13
+
14
+ @model
15
+ def model_ret(name):
16
+ def model(df: DataFrame, ops: ZenoOptions):
17
+ return ModelReturn(model_output=df[ops.data_column])
18
+
19
+ return model
20
+
21
 
22
  @distill
23
  def length(df: DataFrame, ops: ZenoOptions):
24
+ return DistillReturn(distill_output=df["prompt"].str.len())
25
 
26
 
27
  @metric
28
  def avg_image_nswf(df: DataFrame, ops: ZenoOptions):
29
+ return MetricReturn(metric=float(df["image_nsfw"].dropna().mean()))
30
 
31
 
32
  @metric
33
  def avg_prompt_nsfw(df: DataFrame, ops: ZenoOptions):
34
+ return MetricReturn(metric=float(df["prompt_nsfw"].dropna().mean()))
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- zenoml>=0.3.14
2
  pyarrow
 
1
+ zenoml>=0.4.6
2
  pyarrow