Provide a layout sample for vendor CS

{
  "layout_loc":
    "File \"src/lib/mina_networking/mina_networking.ml\", line 321, characters 8-143:",
  "version_opt": null,
  "type_decl":
    "type response = (State_hash.Stable.V1.t * State_body_hash.Stable.V1.t list) option",
  "bin_io_derived": true,
  "bin_prot_rule": [
    "Option",
    [
      "Tuple",
      [
        [
          "Reference",
          [
            "Resolved",
            {
              "source_type_decl": "type t = { version: int ; t: typ }",
              "ref_rule": [
                "Record",
                [
                  { "field_name": "version", "field_rule": [ "Int" ] },
                  {
                    "field_name": "t",
                    "field_rule": [
                      "Reference",
                      [
                        "Resolved",
                        {
                          "source_type_decl": "type typ = t",
                          "ref_rule": [
                            "Reference",
                            [
                              "Resolved",
                              {
                                "source_type_decl": "type t = Field.t",
                                "ref_rule": [
                                  "Reference",
                                  [
                                    "Resolved",
                                    {
                                      "source_type_decl": "Tick.Field.t",
                                      "ref_rule": [ "String" ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ],
        [
          "List",
          [
            "Reference",
            [
              "Resolved",
              {
                "source_type_decl": "type t = { version: int ; t: typ }",
                "ref_rule": [
                  "Record",
                  [
                    { "field_name": "version", "field_rule": [ "Int" ] },
                    {
                      "field_name": "t",
                      "field_rule": [
                        "Reference",
                        [
                          "Resolved",
                          {
                            "source_type_decl": "type typ = t",
                            "ref_rule": [
                              "Reference",
                              [
                                "Resolved",
                                {
                                  "source_type_decl": "type t = Field.t",
                                  "ref_rule": [
                                    "Reference",
                                    [
                                      "Resolved",
                                      {
                                        "source_type_decl": "Tick.Field.t",
                                        "ref_rule": [ "String" ]
                                      }
                                    ]
                                  ]
                                }
                              ]
                            ]
                          }
                        ]
                      ]
                    }
                  ]
                ]
              }
            ]
          ]
        ]
      ]
    ]
  ]
}

Just to note, fields don't serialize to String, that's a dummy entry for now.

Is there some documentation kicking around that describes this layout formula?
Could you provide some simple examples of layout -> rust/pseudocode for some basic toy structs?

Is there some documentation kicking around that describes this layout format?

Here is the OCaml file defining the format:
https://github.com/o1-labs/ppx_version/blob/master/src/runtime/bin_prot_layout.ml
That refers to the rules in this file:
https://github.com/o1-labs/ppx_version/blob/master/src/runtime/bin_prot_rule.ml
Here are some tests that give an OCaml type with their expected layout:
https://github.com/o1-labs/ppx_version/blob/feature/layouts-via-ppx-bin-prot/test/layouts_good.ml

Could you provide some extremely simple examples of layout -> rust/pseudocode for some basic toy structs?

I don't know Rust well enough to attempt that.

@bkase @psteckler @jspada
In an attempt to create a layout parser in https://github.com/ChainSafe/mina-rs/pull/25, we felt a few quirks about the json layout:

Record rules does not contain the record name, making it difficult to generate/reference equivalent Rust types.
The leaf nodes of the bin_prot_rule json tree currently resolves to a string and not the actual type
json expansion of type defs is repeated quite a bit and probably that makes the type def quite large for some types (ex: external_transition.ml. Feeding external_transition layout json takes like 3 minutes to parse.

cc @willemolding

As mentioned, the rules for some types, like Field.t, are placeholders for now.
I think it's possible to add the module path to types, including record types.
Not sure what to do with the size of the JSON. It might be possible to splice out the Reference indirections, though those are useful to understand where the types came from.

For Resolved references, I can add an autogenerated module path, like:
"Resolved",
 {
  "source_type_decl":
  "type t = { version: int ; t: typ }",
  "source_module_path":"src/lib/mina_state/protocol_state.ml.Body.Value",
  "bin_io_derived":true,
  "ref_rule": [ Record ...

Does that help? @creativcoder

I can probably refine that to syntax like Protocol_state.Body.Value

We can probably compress chains of Resolved indirections to a single Resolved, which would shrink the size of the JSON.

Hey @psteckler  yes, tidying module path and compressing references and resolved subtree would reduce the complexity by a fair amount.

We are making great progress with parsing a block from a layout. Currently it appears the only thing it is choking on is the Vector_{2,4,8,16} types.
As previously mentioned these types use a custom serialization strategy and so a custom deserializer must be provided. This is the strategy used for the other custom serialization types (e.g. Field.t, StateHash etc.).
Unlike the other custom strategies the Vector types appear to be generic over their elements. What this means is that even though we might know the overall strategy for serializing a vector type (e.g. serialize and write the elements sequentially with a null termination byte), the information about the types of the elements and their serialization is lost when producing a layout.

While I'm not sure of the feasibility of this, as a consumer of a layout file the ideal solution would be to have vector types have their own custom BinProtRule variant:
  | Vec of int * t

which would contain the length of the vec (e.g. 2,4,6,18) and the rule to be used to when deserializing the elements.

This is currently the main thing blocking our ability to deserialize blocks from the network and meet milestone 1 so it would be great to throw some ideas out there. Any thoughts @psteckler @creativcoder ?

I'm reluctant to add special-case rules that don't correspond to the Jane Street rules.
Instead, for each OCaml-side custom serialization, at the Rust end, I would suggest matching the type involved, and invoke custom serialization code there.
The serialization of these vector types are parametric in a length. For Vector_2:
include Make.Binable (Nat.N2)

The result of these functor invocations are serializers and deserializers that are themselves parametric in the element type, because the type has a parameter a:
type 'a t = ('a, Nat.N2.n) vec

Presumably, you could write a family of serializers/deserializers that are parametric on the length and element type in a similar way.
The bit that I don't understand is how the serialization provided by Make.Binable works. Can @imeckler or @mrmr1993 shed any light?

Thanks @psteckler, That seems totally reasonable as well. The trick is going to be ensuring that the rules for serializing the concrete types provided in the type parameters (is that what they are called in OCaml?) are available in the layout file.
Perhaps we could allow the Custom variant to carry a list of rules (similar to the Tuple rule variant). It would then be up to the author of the deserializer to match the type and consume these rules in the deserialization code.

At the definition of Vector_2, for instance, you don't know what the element type is, of course.
Somewhere, that type gets instantiated, and maybe that's missing from the layout, as currently given.

Yes, all the type parameter instantiation is known at compile-time.
The layout code is new, and there may be things I've overlooked.

After discussion with Matthew, it looks like the serialization of a Vector_n uses a nested tuple format. For 'a Vector_2, the rule would be:
Tuple [the_rule_for_a;Tuple [the_rule_for_a;Unit]]

For any 'a Vector_n, the list arguments to Tuple have two elements, where the first element is the rule for 'a, and the second element is either another such Tuple rule, or Unit.
@willemolding is that enough to go on?

Sweet, I had managed to figure that much out already by inspecting the binary but it is great to have it confirmed.

The issue still stands currently that the the_rule_for_a is not present in the layout. For example here is a vector_2 in the external_transition_layout:
{
    "source_type_decl": "type 'a typ = 'a t",
    "source_module_path": "Vector.Vector_2",
    "bin_io_derived": false,
    "ref_rule": [
        "Custom"
    ]
}

As you can see it does not expand any further as to the type of 'a.
I don't have the OCaml knowledge or understanding of ppx_version to add it in unfortunately.


Feature request: retry delay

Hi there,
Great project - I'm really enjoying using listr2 so far (only used it for a few days but really cleaned up some existing boiler plate code).
However, when I write a task that can be retried, I find myself writing this boiler plate code over and over again:
        task: async (ctx, task) => {
            if (task.isRetrying()) {
                await delay(1000);
            }

            // code here
        },

I have to imagine this is a pretty common use case with retry. I'd be happy to open a PR which tries to add a retryDelay feature (and maybe potentially add something to the renderer?)

Yeah pretty doable. I can make the retry optionally as an object where you can pass count and delay in between.
I will try to add this whenever I find time to finalize the beta version.

:tada: This issue has been resolved in version 6.0.0-beta.11 :tada:
The release is available on:

npm package (@beta dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

Please check out the related section in the documentation here. This is currently only available through the beta version, but will be finalized soon if there is no other input.

:tada: This issue has been resolved in version 6.0.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


2015-05-14 - Tests

Date
May 14th
Speakers
@peterjwest #61

I can cover: mocha (better than jasmine), sinon, chai, nock, supertest, istanbul, phantomjs and protractor
Could maybe cover hooking it all together with gulp.

@spikeheap #44

Ryan Brooks – The most convoluted JavaScript testing framework?
Ryan wants to talk about an abomination he built to test JavaScript running on the Rhino JavaScript engine, and how an optimistic "of course you can test that, it's just JavaScript" led to a rabbit hole and lost sleep.

Core actions

[ ] Confirm sponsorship for snacks/drinks (@spikeheap)
[ ] Confirm availability of White October (@benfoxall)
[x] Organise speakers

Event organisation

[ ] Ensure someone has carried out the actions above
[x] Add to MeetUp.com (just prior to preceding event)
[ ] Announce event

ace!! @AverageMarcus do you want to lead this one?  Involves introducing talks, and generally being in control of stuff.

Yeah, why not?
May need a little guidance in what I need to do in the run up.

\o/  - cool!

Happy to help @AverageMarcus :+1:

:smiley:
@spikeheap / @peterjwest - when you have a title and description for your talk can you update this issue with them please?

I'll probably be a bit delayed (down in London for TalkWD).
@elucas @garrettc @Drarok @olorton @rjmunro - would any of you be able to stick around to help with setup?

I'm happy to show up early to help set up.

Yay! Count me in for chair+desk moving etc :)
On 30 March 2015 at 10:07, Marcus Noble<EMAIL_ADDRESS>wrote:

I'm happy to show up early to help set up.
—
Reply to this email directly or view it on GitHub
https://github.com/jsoxford/jsoxford.github.com/issues/62#issuecomment-87603576
.

Ace! thanks @elucas

Only just seen this, sorry. Is JSOxford moving to Thursdays? Happy to help out if so, can't to the usual(?) Wednesdays.

Guess I should make sure @peterjwest is OK with the new date so we can line up with digital Oxford week.

New date - May 14th
Switching to may 14th to align with digital oxford week.  Can everyone make it?

[ ] @AverageMarcus
[ ] @peterjwest
[ ] @spikeheap
[ ] @elucas

Once we can, let's create the meetup

I'm good, sorry been ill for a few days.

@peterjwest Hope you're feeling better. Would you mind putting a summary together before RTHack? Want to get the next meetup event up so we can mention it to people.

@AverageMarcus you should now have access to the draft meetup:
http://www.meetup.com/JSOxford/events/221556244/
I guess the things you want to tweak/add are:

[ ] title
[ ] intro / description
[ ] @peterjwest's talk
[ ] @spikeheap's talk (see #44)

No rush - but would be cool to have it announcable for next RTHack!

Awesome meetup everyone! :+1:
Thanks @peterjwest  and @spikeheap


Handle other log drivers

Hi,
When using a log driver that is not json or syslog, the API can't access the logs
The call to
/api/endpoints/2/docker/containers/e96b2105e0b7ff1374953cdb845fcfb8a0016b4e14b58decee06e250483b0985/logs?stderr=0&stdout=1&tail=2000&timestamps=0

return a 501 error with
{"message":"configured logging driver does not support reading"}

Portainer should handle the return and display the message to user

Maybe prevent the access to the logs feature in that case?

I think we can retrieve info in HostConfig.LogConfig.Type of container
And same for swarm services
In my test case, I got something like :
            "LogConfig": {
                "Type": "redis-log-driver",
                "Config": {
                    "labels": "label1,label2",
                    "redis-address": "redis:6379",
                    "redis-list": "logstash"
                }
            },
...

Great. Is this issue also happening when accessing log services?

I don't test in portainer, but I think so, as the log is unavailable by docker service logs command

This will be addressed in #3749


gh-50: typing inline completed

This PR adds all Inline objects #38  with type hints #50
However, some objects depend on #56 which is not yet implemented

Alright, I think it's safe to convert this PR into a draft till #56 is resolved


[DOC] fix sym.arange doc

Description
Make sym.arange documentation consistent with that of nd.arange and np.arange. @icemelon9
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.

[ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
[x] Changes are complete (i.e. I finished coding on this PR)
[x] All changes have test coverage:
Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
[x] Code is well-documented:
For user-facing API changes, API doc string has been updated.
For new C++ functions in header files, their functionalities and arguments are documented.
For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
[ ] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

[ ] Feature1, tests, (and when applicable, API doc)
[ ] Feature2, tests, (and when applicable, API doc)

Comments

If this change is a backward incompatible change, why must this change be made.
Interesting edge cases to note here

@mxnet-label-bot add [Doc]

@eric-haibin-lin could you re-trigger CI?
@mxnet-label-bot add [pr-awaiting-merge]
PR can be merged once CI passes.


allow user to configure tmp socket directory

added in https://github.com/seanbreckenridge/mpv-sockets/commit/532a2a67832ec84a185f1d46f7d21e85e8f294b3


opening the downloaded fic file after it's done

either a --exec flag on the command or printing the destination folder to stdout

You mean you want to be able to open the downloaded file in an ebook reader app once the download is complete? Thats outside the core purpose of the CLI and unfortunately, I neither have the time nor the will to add this feature.

@arzkar I will try to work on this myself; since it should be simple enough.
Should I open a PR?

Sure, you can work on it and open a PR.


Documentation - Fix

some imports were causing build dependencies.
mocked those imports

Codecov Report

Merging #98 (aca2591) into main (687163f) will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
- Coverage   89.95%   89.90%   -0.05%
==========================================
  Files          69       69
  Lines        2299     2299
==========================================
- Hits         2068     2067       -1
- Misses        231      232       +1

Impacted Files
Coverage Δ

torchflare/callbacks/progress_bar.py
93.06% <0.00%> (-1.00%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 687163f...aca2591. Read the comment docs.


Add NeoPixel Example

Description
Not the first time I've seen some buzz around NeoPixel LED's.
A basic single strip example would probably suffice the first time around.
Would recommend using the library blinkchain by Greg Mefford's as a starting example.
Maybe a future book would be to use i2c on a leader/follow setup to control more than 2 pwm channels.

NeoPixels require DMA-controller tricks to use on the RPi and can't be used on other Nerves-supported boards easily. To my knowledge, Greg no longer actively maintains blinkchain and it doesn't look like it works on newer Raspberry Pis. I did see a PR for support, so if that gets pulled, maybe it will be better?
How about instead of NeoPixels, using SK9822 or APA102C-based LED strips? They do the same thing except the protocol uses SPI. This means that you can control them directly with circuits_spi and they'd work on all Nerves devices with SPI buses. Adafruit sells them under the DotStar brand. You can also get them from many other places like Pololu


[TISPARK-17]Partial support for spark 2.2.0

This is a partial upgrade for Spark 2.2.0, Thriftserver module is removed due to it's severe in-compatibility with 2.2.0. There's also minor change in CollectHandles.scala and PromotedSum.scala which removed some fields.

/run-all-tests

pyspark works normally.

/run-all-tests

/run-all-tests

/run-all-tests

We will move to 2.3
https://github.com/pingcap/tispark/pull/360


Form error message doesn't work properly with inline label

Due to the way the form inline label is styled (using table display) the error message does not display properly. Here are three possible approaches to a fix:

Add extra HTML/CSS around the label (example linked)
Update javascript to look outside the parent for error message
Change the CSS for inline labels/inputs to not use table layout

I don't know what the best solution is, but I got number 1 working. The issue, and that fix may be seen on this pen I made.

The second solution seems ideal if we can make it work. As I recall, Abide tries to just magically find the error element that goes with the input, but we should have a way to manually associate them. Maybe by putting aria-describedby on the error?

Currently, inline labels don't actually use actual  tags. We could require a label wrap the whole thing and put the error inside it.

  Money

    $
    <input class="input-group-field is-invalid-input" type="number" required aria-invalid aria-describedby="foo">

  This field is required.

Any update on this?

+1

I think the right answer here is probably to make Abide more specific... you should be able to point each element to its' error label, with fallback to the "default" magic finding.

Not sure if this is a proper fix, but keeping the span inside the label but adding data-abide-error attribute to it seems to fix the issue?
`                    Email Address*

Email address is missing or not complete.

                    Please enter your email address.

`

Perhaps someone else can check this?

I'd definitely like to see a fix for this where we can do something like this on the input:
data-abide-form-error="#myFieldFormErrorContainer"

+1

@IamManchanda want to take a look at this as a part of your JS practice?

+1

The markup recommended by @Quisp worked for me. I needed to add data-abide-error into my span outside of the group and it started working


iqnoise is pixelated

Arch Linux, Nvidia, driver 430.34, Imogen dev-0.14.

Hi axredneck
The sample material is not updated with recent changes. It's a material sample issue, not a code one.
Select the iqnoise node, change size to 10 and set V to 1. And it should look fine :)


Pre-select sorting before starting the lengthy profile search?

Is there an option to pre-select how accounts are sorted before the lengthy searching phase?  There's a ton of time spent calling up old expired profiles that I have no interest in, so it be nice to default to a sorting option that cuts that out from the search completely.  Does a feature like this exist already?

The only real control over data fetching we have is
--user-list
You can do
-- userlist  "ofscraper.active"
This will restrict your account to only getting active accounts
There is also the sort options but these only effect what is seen by the user, the full user list is stored in memory, to allow dynamic changing of the filters.
-- sort


Failure in convert Gemma 2B models to TfLite

I tried converting Google Gemma 2B models to TfLite. Found it ending in failure
1. System information

Ubuntu 22.04
TensorFlow installation (installed with keras-nlp) :
TensorFlow library (installed with keras-nlp):

2. Code
import os
import keras
import os
import numpy as np
import keras_nlp
import tensorflow as tf
import tensorflow_text as tf_text
from tensorflow import keras
from tensorflow.lite.python import interpreter
import time

os.environ["KAGGLE_USERNAME"] = "rag"
os.environ["KAGGLE_KEY"] = 'e7c'
os.environ["KERAS_BACKEND"] = "tensorflow"  # Or "tensorflow" or "torch".

preprocessor = keras_nlp.models.GemmaCausalLMPreprocessor.from_preset('gemma_2b_en', sequence_length=4096, add_end_token=True
)
generator = keras_nlp.models.GemmaCausalLM.from_preset("gemma_2b_en")

def run_inference(input, generate_tflite):
  interp = interpreter.InterpreterWithCustomOps(
      model_content=generate_tflite,
      custom_op_registerers=tf_text.tflite_registrar.SELECT_TFTEXT_OPS)
  interp.get_signature_list()

  preprocessor_output = preprocessor.generate_preprocess(
    input, sequence_length=preprocessor.sequence_length
  )
  generator = interp.get_signature_runner('serving_default')
  output = generator(preprocessor_output)
  output = preprocessor.generate_postprocess(output["output_0"])
  print("\nGenerated with TFLite:\n", output)

generate_function = generator.make_generate_function()
concrete_func = generate_function.get_concrete_function({
  "token_ids": tf.TensorSpec([None, 4096]),
  "padding_mask": tf.TensorSpec([None, 4096])
})

converter = tf.lite.TFLiteConverter.from_concrete_functions([concrete_func],
                                                            generator)
converter.target_spec.supported_ops = [
  tf.lite.OpsSet.TFLITE_BUILTINS, # enable TensorFlow Lite ops.
  tf.lite.OpsSet.SELECT_TF_OPS # enable TensorFlow ops.
]
converter.allow_custom_ops = True
converter.target_spec.experimental_select_user_tf_ops = ["UnsortedSegmentJoin", "UpperBound"]
converter._experimental_guarantee_all_funcs_one_use = True
generate_tflite = converter.convert()
run_inference("I'm enjoying a", generate_tflite)

with open('unquantized_mistral.tflite', 'wb') as f:
  f.write(generate_tflite)

3. Failure after conversion
I am getting this error:
tensorflow/core.py":65:1))))))))))))))))))))))))))]): error: missing attribute 'value'
LLVM ERROR: Failed to infer result type(s).
Aborted (core dumped)
5. (optional) Any other info / logs
2024-02-22 06:34:41.094712: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:378] Ignored output_format.
2024-02-22 06:34:41.094742: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:381] Ignored drop_control_dependency.
2024-02-22 06:34:41.095691: I tensorflow/cc/saved_model/reader.cc:83] Reading SavedModel from: /tmp/tmp58p378bn
2024-02-22 06:34:41.140303: I tensorflow/cc/saved_model/reader.cc:51] Reading meta graph with tags { serve }
2024-02-22 06:34:41.140329: I tensorflow/cc/saved_model/reader.cc:146] Reading SavedModel debug info (if present) from: /tmp/tmp58p378bn
2024-02-22 06:34:41.233389: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:388] MLIR V1 optimization pass is not enabled
2024-02-22 06:34:41.264724: I tensorflow/cc/saved_model/loader.cc:233] Restoring SavedModel bundle.
2024-02-22 06:34:43.697440: I tensorflow/cc/saved_model/loader.cc:217] Running initialization op on SavedModel bundle at path: /tmp/tmp58p378bn
2024-02-22 06:34:44.189111: I tensorflow/cc/saved_model/loader.cc:316] SavedModel load for tags { serve }; Status: success: OK. Took 3093423 microseconds.
2024-02-22 06:34:45.009212: I tensorflow/compiler/mlir/tensorflow/utils/dump_mlir_util.cc:269] disabling MLIR crash reproducer, set env var `MLIR_CRASH_REPRODUCER_DIRECTORY` to enable.
loc(fused["ReadVariableOp:", callsite("decoder_block_0_1/attention_1/attention_output_1/Cast/ReadVariableOp@__inference_generate_step_12229"("/workspace/gem.py":38:1) at callsite("/usr/local/lib/python3.10/dist-packages/keras_nlp/models/gemma/gemma_causal_lm.py":258:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras_nlp/models/gemma/gemma_causal_lm.py":235:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras_nlp/models/gemma/gemma_causal_lm.py":212:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras_nlp/models/gemma/gemma_causal_lm.py":214:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py":118:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py":816:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py":118:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py":42:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py":157:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras_nlp/models/gemma/gemma_decoder_block.py":147:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py":118:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py":816:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py":118:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py":42:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py":157:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras_nlp/models/gemma/gemma_attention.py":193:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py":118:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py":816:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py":118:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py":42:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py":157:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/layers/core/einsum_dense.py":218:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/ops/numpy.py":2414:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/numpy.py":90:1 at callsite("/usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/numpy.py":91:1 at "/usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/core.py":65:1))))))))))))))))))))))))))]): error: missing attribute 'value'
LLVM ERROR: Failed to infer result type(s).
Aborted (core dumped)

Hi @RageshAntonyHM,
I am trying to reproduce the issue while I had another error ModuleNotFoundError: No module named 'keras_nlp.backend, could you please confirm the version of it.
Thank You

@LakshmiKalaKadali
it is keras 3.0.5 and installed keras-nlp via pip install git+https://github.com/keras-team/keras-nlp (0.8.1)

@LakshmiKalaKadali
first install  pip install git+https://github.com/keras-team/keras-nlp and then update Keras (pip install -U keras)

Also crashing in Colab with or without quantization.

@farmaker47
This conversion pipeline needs lot of Vram. At Least 24 GB.
@LakshmiKalaKadali any updates on this please?

@urim85
Yeah. Actually, till it is crashing for me in 48 GB RTX 6000.
(What I told to @farmaker47  was,  it will crash prematurally if VRAM is low. But also crashes in final step even if you have enough VRAM)

I saw that training is working OK having installed first TensorFlow nightly version. @RageshAntonyHM can you try with nightly version and check again the conversion?

@farmaker47
How to install  TensorFlow nightly version? I tried pip install tf-nightly, but I am getting error
File "/usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/core.py", line 5, in
from tensorflow.compiler.tf2xla.python.xla import dynamic_update_slice
ModuleNotFoundError: No module named 'tensorflow.compiler.tf2xla'

@farmaker47
Now, again I am getting that first mentioned error
could you please share your notebook link ?

The colab is from this example
https://ai.google.dev/gemma/docs/lora_tuning
I have changed nothing. So the idea is if you install tf-nightly the error for conversion disappears? I don't understand from your previous answer if the error is during tf-nightly installation or during conversion.

@farmaker47
I hope some package conflicts ,like some packages reinstall 'stable' version of tensorflow. Let me check

@farmaker47
I able to ran inference already. my problem is, i need to create a TFlite model for Gemma 2B. I think there is some problem still in conversion
i am very new to AI and even python.

@farmaker47
I able to ran inference already. my problem is, i need to create a TFlite model for Gemma 2B. I think there is some problem still in conversion
i am very new to AI and even python.

Then we have to wait a little bit so the TF team solves this and provide us the tf-nightly version we can use to convert it.

@LakshmiKalaKadali
keras_nlp.backend import ops
is not needed. Sorry
But when using all nightly versions, I got some "GraphDef" issue

a minimal script to reproduce the issue
import keras
import keras_nlp
import tensorflow as tf

os.environ["KAGGLE_USERNAME"] = '....'
os.environ["KAGGLE_KEY"] = '...'
os.environ["KERAS_BACKEND"] = "tensorflow"

gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset("gemma_2b_en")
tf.saved_model.save(gemma_lm.backbone, '/tmp/gemma_saved_model/')

f = tf.lite.TFLiteConverter.from_saved_model('/tmp/gemma_saved_model/').convert()

I tested with tf-2.15, 2.16, and 2.17 nightly and their corresponding packages. None of them works.

Hi @pkgoogle,
I have reproduced the issue in Colab with TF 2.15, the session crashed at the step generator = keras_nlp.models.GemmaCausalLM.from_preset("gemma_2b_en") . Please take a look.
Thank You

Adding @advaitjain for visibility.

I believe colab is running out of memory for @LakshmiKalaKadali 's case,
In attempting to replicate the below, I am running into tensorflow-text installation issues (apparently the Gemma tokenizer uses it for the tokenizer), this may be because of the new 2.16 release.
import keras
import keras_nlp
import tensorflow as tf

os.environ["KAGGLE_USERNAME"] = '....'
os.environ["KAGGLE_KEY"] = '...'
os.environ["KERAS_BACKEND"] = "tensorflow"

gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset("gemma_2b_en")
tf.saved_model.save(gemma_lm.backbone, '/tmp/gemma_saved_model/')

f = tf.lite.TFLiteConverter.from_saved_model('/tmp/gemma_saved_model/').convert()

I think there is an answer here that it is working:
https://github.com/keras-team/keras/issues/19108
It is based on this comment:
https://github.com/keras-team/keras/issues/19108#issuecomment-1913421572
So my code now is:
model.export("test", "tf_saved_model")
converter = tf.lite.TFLiteConverter.from_saved_model("test")
tflite_model = converter.convert()
with open("model.tflite", "wb") as f:
    f.write(tflite_model)

With the above the conversion finishes and the .tflite model is running into android. I have not used quantization since it is failing into android.

@farmaker47
I ran like this:
import os
import keras
import os
import numpy as np
import keras_nlp
import tensorflow as tf
import tensorflow_text as tf_text
from tensorflow import keras
from tensorflow.lite.python import interpreter
import time

os.environ["KAGGLE_USERNAME"] = "rageshantony"
os.environ["KAGGLE_KEY"] = 'e7cf61786582ae35e8ec30e8c94187d6'
os.environ["KERAS_BACKEND"] = "tensorflow"  # Or "tensorflow" or "torch".

preprocessor = keras_nlp.models.GemmaCausalLMPreprocessor.from_preset('gemma_2b_en', sequence_length=4096, add_end_token=True
)
model = keras_nlp.models.GemmaCausalLM.from_preset("gemma_2b_en")
print("exporting")
model.export("test", "tf_saved_model")
print("converting")
converter = tf.lite.TFLiteConverter.from_saved_model("test")
tflite_model = converter.convert()
print("writiing")

with open("model.tflite", "wb") as f:
    f.write(tflite_model)

Iit fails at "converting" with this error "GPU:0 in order to run Identity: Dst tensor is not initialized. [Op:Identity] name:     " :
2024-02-28 17:40:21.522813: I external/local_tsl/tsl/framework/bfc_allocator.cc:1114] Stats:
Limit:<PHONE_NUMBER>0
InUse:<PHONE_NUMBER>0
MaxInUse:<PHONE_NUMBER>0
NumAllocs:                        1629
MaxAllocSize:<PHONE_NUMBER>
Reserved:                            0
PeakReserved:                        0
LargestFreeBlock:                    0

2024-02-28 17:40:21.522846: W external/local_tsl/tsl/framework/bfc_allocator.cc:497] ****************************************************************************************************
Traceback (most recent call last):
  File "/workspace/gem.py", line 22, in <module>
    converter = tf.lite.TFLiteConverter.from_saved_model("test")
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/lite/python/lite.py", line 2087, in from_saved_model
    saved_model = _load(saved_model_dir, tags)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/saved_model/load.py", line 912, in load
    result = load_partial(export_dir, None, tags, options)["root"]
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/saved_model/load.py", line 1043, in load_partial
    loader = Loader(object_graph_proto, saved_model_proto, export_dir,
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/saved_model/load.py", line 226, in __init__
    self._restore_checkpoint()
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/saved_model/load.py", line 561, in _restore_checkpoint
    load_status = saver.restore(variables_path, self._checkpoint_options)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/checkpoint/checkpoint.py", line 1479, in restore
    checkpoint=checkpoint, proto_id=0).restore(self._graph_view.root,
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/checkpoint/restore.py", line 62, in restore
    restore_ops = self._restore_descendants(reader)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/checkpoint/restore.py", line 463, in _restore_descendants
    current_position.checkpoint.restore_saveables(
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/checkpoint/checkpoint.py", line 379, in restore_saveables
    registered_savers).restore(self.save_path_tensor, self.options)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/checkpoint/functional_saver.py", line 499, in restore
    restore_ops = restore_fn()
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/checkpoint/functional_saver.py", line 467, in restore_fn
    ret = restore_fn(restored_tensors)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/training/saving/saveable_object_util.py", line 747, in _restore_from_tensors
    return saveable_object_to_restore_fn(self.saveables)(restored_tensors)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/training/saving/saveable_object_util.py", line 784, in _restore_from_tensors
    restore_ops[saveable.name] = saveable.restore(
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/training/saving/saveable_object_util.py", line 602, in restore
    ret = restore_fn(restored_tensor_dict)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/ops/resource_variable_ops.py", line 779, in _restore_from_tensors
    restored_tensor = array_ops.identity(
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/ops/weak_tensor_ops.py", line 88, in wrapper
    return op(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/framework/ops.py", line 5883, in raise_from_not_ok_status
    raise core._status_to_exception(e) from None  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InternalError: Failed copying input tensor from

/job:localhost/replica:0/task:0/device:CPU:0 to /job:localhost/replica:0/task:0/device:GPU:0 in order to run Identity: Dst tensor is not initialized. [Op:Identity] name:

Am I doing something wrong ?

You can skip the Kaggle_key...😀
I think it's a memory error

@farmaker47
I rented 48 GB GPU, now got another error  :
converting
2024-02-28 17:51:39.439053: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:378] Ignored output_format.
2024-02-28 17:51:39.439136: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:381] Ignored drop_control_dependency.
2024-02-28 17:51:39.440216: I tensorflow/cc/saved_model/reader.cc:83] Reading SavedModel from: test
2024-02-28 17:51:39.459869: I tensorflow/cc/saved_model/reader.cc:51] Reading meta graph with tags { serve }
2024-02-28 17:51:39.459902: I tensorflow/cc/saved_model/reader.cc:146] Reading SavedModel debug info (if present) from: test
2024-02-28 17:51:39.760067: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:388] MLIR V1 optimization pass is not enabled
2024-02-28 17:51:39.808678: I tensorflow/cc/saved_model/loader.cc:233] Restoring SavedModel bundle.
2024-02-28 17:51:44.034223: I tensorflow/cc/saved_model/loader.cc:217] Running initialization op on SavedModel bundle at path: test
2024-02-28 17:51:44.392812: I tensorflow/cc/saved_model/loader.cc:316] SavedModel load for tags { serve }; Status: success: OK. Took 4952596 microseconds.
2024-02-28 17:51:44.754857: I tensorflow/compiler/mlir/tensorflow/utils/dump_mlir_util.cc:269] disabling MLIR crash reproducer, set env var `MLIR_CRASH_REPRODUCER_DIRECTORY` to enable.
Summary on the non-converted ops:
---------------------------------
 * Accepted dialects: tfl, builtin, func
 * Non-Converted Ops: 220, Total Ops 2416, % non-converted = 9.11 %
 * 184 ARITH ops, 36 TF ops

- arith.constant:  184 occurrences  (f32: 153, i32: 31)

- tf.StridedSlice:   36 occurrences  (i1: 18, i32: 18)
  (f32: 127)
  (f32: 36)
  (i1: 18)
  (f32: 36, i32: 20)
  (i32: 72)
  (f32: 18)
  (f32: 37)
  (i1: 18)
  (f32: 19, i1: 18)
  (f32: 127)
  (f32: 1, i32: 90)
  (f32: 18)
  (i1: 18)
  (i32: 1)
  (f32: 37)
  (i32: 19)
  (f32: 272)

  (f32: 36, i32: 90)
  (f32: 18)
  (i1: 18)
  (f32: 252)
  (f32: 18)
  (i32: 180)
  (f32: 18)
  (f32: 18)
  (f32: 36)
  (f32: 37)
  (f32: 37)
  (f32: 36, i32: 180)
  (f32: 54)
  (f32: 90)
  (i32: 54)
  (f32: 18)
Killed

The process terminates with "killed" message. Didn't enter "writing" !

@RageshAntonyHM this looks like the OS terminated the process, maybe due to memory consumption/cpu time limitation?

@RageshAntonyHM looks like it is still memory and compute issue

I think there is an answer here that it is working: keras-team/keras#19108 It is based on this comment: keras-team/keras#19108 (comment)
So my code now is:
model.export("test", "tf_saved_model")
converter = tf.lite.TFLiteConverter.from_saved_model("test")
tflite_model = converter.convert()
with open("model.tflite", "wb") as f:
    f.write(tflite_model)

With the above the conversion finishes and the .tflite model is running into android. I have not used quantization since it is failing into android.

I can cofirm that I could get tflite by using:
gemma_lm.backbone.export('/tmp/gemma_saved_model')

instead of
tf.saved_model.save(gemma_lm.backbone, '/tmp/gemma_saved_model/')

Note that the converter seems not memory efficient; I observed more than 90 GiB virtual memory was needed on my desktop machine.

@freedomtan can you share your working colab here

@freedomtan can you share your working colab here

nope, because I tested it with a simple script on my local machine; didn't try to deal with memory issues in Colab  :-)
import keras
import keras_nlp
import tensorflow as tf

os.environ["KAGGLE_USERNAME"] = '....'
os.environ["KAGGLE_KEY"] = '...'
os.environ["KERAS_BACKEND"] = "tensorflow"

gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset("gemma_2b_en")
gemma_lm.backbone.export('/tmp/gemma_saved_model')

tflite_model = tf.lite.TFLiteConverter.from_saved_model('/tmp/gemma_saved_model/').convert()
with open("model.tflite", "wb") as f:
    f.write(tflite_model)

For test, I modified keras_nlp to have fixed tensor dimensions. That's it.

@freedomtan @farmaker47 @nyadla-sys @zichuan-wei
Can I know the System configuration needed such as GPU , VRAM and Sys RAM ?

@freedomtan @farmaker47 @nyadla-sys @zichuan-wei
Can I know the System configuration needed such as GPU , VRAM and Sys RAM ?

my desktop is an old Linux box with 64 GiB DRAM and 128 GiB swap space.
GPU is irrelevant.

@freedomtan
Thanks
But why GPU is irrelevant ?. I have seen 96 % GPU VRAM usage even in 48 GB A6000

@freedomtan
I got an error in A100 80 GB, 85 GB RAM pod. I ran you code given in 'nope, because I tested it with a simple script,,,,,'
Details:
        tf.StridedSlice(tensor<?x?x1xi1>, tensor<4xi32>, tensor<4xi32>, tensor<4xi32>) -> (tensor<?x?x1x1xi1>) : {begin_mask = 7 : i64, ellipsis_mask = 0 : i64, end_mask = 7 : i64, new_axis_mask = 8 : i64, shrink_axis_mask = 0 : i64}
        tf.StridedSlice(tensor<?x?x?xi32>, tensor<5xi32>, tensor<5xi32>, tensor<5xi32>) -> (tensor<?x1x1x?x?xi32>) : {begin_mask = 25 : i64, device = "", ellipsis_mask = 0 : i64, end_mask = 25 : i64, new_axis_mask = 6 : i64, shrink_axis_mask = 0 : i64}

Traceback (most recent call last):
  File "/workspace/gem.py", line 13, in <module>
    tflite_model = tf.lite.TFLiteConverter.from_saved_model('/workspace/gemma_saved_model/').convert()
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/lite/python/lite.py", line 1139, in wrapper
    return self._convert_and_export_metrics(convert_func, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/lite/python/lite.py", line 1093, in _convert_and_export_metrics
    result = convert_func(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/lite/python/lite.py", line 1465, in convert
    return self._convert_from_saved_model(graph_def)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/lite/python/lite.py", line 1331, in _convert_from_saved_model
    result = _convert_saved_model(**converter_kwargs)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/lite/python/convert_phase.py", line 212, in wrapper
    raise converter_error from None  # Re-throws the exception.
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/lite/python/convert_phase.py", line 205, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/lite/python/convert.py", line 1001, in convert_saved_model
    data = convert(
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/lite/python/convert.py", line 366, in convert
    raise converter_error
tensorflow.lite.python.convert_phase.ConverterError: Could not translate MLIR to FlatBuffer.

@freedomtan
Oh. See you modified the existing codebase of keras-nlp  and installed the pip deps manually from the cloned and modified keras-nlp repo ? Right?
Where I need to modify ?
I am new to this field. See need to understand things

@farmaker47
/// With the above the conversion finishes and the .tflite model is running into android ////
I tried running your code, but it also gave me the same error "Could not translate MLIR to FlatBuffer."
How did you get tflite ?

@farmaker47
/// With the above the conversion finishes and the .tflite model is running into android ////
I tried running your code, but it also gave me the same error "Could not translate MLIR to FlatBuffer."
How did you get tflite ?

I get the same error in other code when saving a model using:
 tf.saved_model.save(model, model_name)

and loading it back using:
import keras
model = keras.layers.TFSMLayer(dP.model_name, call_endpoint='serving_default')

No error when the model is saved using:
model.export(dP.model_name)

(This was tested using TF 2.16.0-rc0)

I get the same error in other code when saving a model using keras v3 and :
 tf.saved_model.save(model, model_name)

and loading it back and performing the tflite conversion:
import keras
model = keras.layers.TFSMLayer(dP.model_name, call_endpoint='serving_default')
converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()

No error when the model is saved using:
model.export(dP.model_name)

(This was tested using TF 2.16.0-rc0)

I gather that the correct way to save a v3 model is with model.export, not with tf.saved_model.save as indicated in the transition guide.

@feranick
Do you able to generate Gemma 2B tflite?
if yes, Could you please provide the full code you used?

No, and I don't intend too am just saying that a similar error is given when using tf.saved_model.save in keras v3 environments.

With the dimensions of token_ids and padding_mask fixed
model = gemma_lm.backbone
export_archive = keras.export.ExportArchive()
export_archive.track(model)
export_archive.add_endpoint(
    name="serve",
    fn=model.call,
    input_signature=[{
        "token_ids": tf.TensorSpec(shape=(None, 3), dtype=tf.float32),
        "padding_mask": tf.TensorSpec(shape=(None, 3), dtype=tf.float32),
    }],
)
export_archive.write_out('gemma_2')

I can convert the saved_model to tflite successfully with Colab Pro + A100 runtime.
the colab notebook I used, https://colab.research.google.com/drive/1zFqfYWK7lcW5_wqGpqoPflr87uiMmykB?usp=sharing

@freedomtan
Thanks. It built successfully
tflite generated. Let me check with Android
The combined code block is
import os
import keras
import keras_nlp

import tensorflow as tf

os.environ["KAGGLE_USERNAME"] = "...."
os.environ["KAGGLE_KEY"] = '....'
os.environ["KERAS_BACKEND"] = "tensorflow"  # Or "tensorflow" or "torch".

print("<======= LOADING =====>")
gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset("gemma_2b_en")

model = gemma_lm.backbone
print("<======= EXPORTING =====>")

export_archive = keras.export.ExportArchive()
print("<======= TRACKING =====>")

export_archive.track(model)
export_archive.add_endpoint(
    name="serve",
    fn=model.call,
    input_signature=[{
        "token_ids": tf.TensorSpec(shape=(None, 3), dtype=tf.float32),
        "padding_mask": tf.TensorSpec(shape=(None, 3), dtype=tf.float32),
    }],
)
print("<======= ARCHIVEING =====>")

export_archive.write_out('gemma_2')
print("<======= CONVERTING =====>")

tflite_model = tf.lite.TFLiteConverter.from_saved_model('gemma_2/').convert()

print("<======= WRITING TDLite =====>")
with open('gemma_2.tflite', 'wb') as f:
  f.write(tflite_model)

print("<======= TFLITE GENERATED =====>")

Use below to generate quantized model would be around2.4gb
Convert the model
converter = tf.lite.TFLiteConverter.from_saved_model('gemma_2/')
converter.target_spec.supported_ops = [
tf.lite.OpsSet.TFLITE_BUILTINS, # enable TensorFlow Lite ops.
tf.lite.OpsSet.SELECT_TF_OPS # enable TensorFlow ops.
]
converter.optimizations = [tf.lite.Optimize.DEFAULT]
tflite_model = converter.convert()
Save the model
with open('gemma2-quantized.tflite', 'wb') as f:
f.write(tflite_model)

Will post the inference results soon

@nyadla-sys
Did you run the inference in Android?

@farmaker47
You told that you able to run it in Android
I generated the quantized model as per @nyadla-sys code and tried running in Android:
   private lateinit var interpreter: Interpreter
    private  val OUTPUT_BUFFER_SIZE = 800
    private val outputBuffer = ByteBuffer.allocateDirect(OUTPUT_BUFFER_SIZE)

    @WorkerThread
    private fun runInterpreterOn(input: String): String {

        interpreter = Interpreter(gemmaTfLiteFile)

        outputBuffer.clear()

        // Run interpreter, which will generate text into outputBuffer
        interpreter.run(input, outputBuffer)

        // Set output buffer limit to current position & position to 0
        outputBuffer.flip()

        // Get bytes from output buffer
        val bytes = ByteArray(outputBuffer.remaining())
        outputBuffer.get(bytes)

        outputBuffer.clear()

        // Return bytes converted to String
        return String(bytes, Charsets.UTF_8)
    }

But I get this error:
Cannot convert between a TensorFlowLite tensor with type FLOAT32 and a Java object of type java.lang.String (which is compatible with the TensorFlowLite type STRING).
How to fix this?

@farmaker47 @nyadla-sys @freedomtan
How to create Gemma Tokenizer for input and outputs in Android ? I think interpreter.run(input, outputBuffer) needs the specific format of Gemma.

After Gemma release they have presented also this for converting Gemma models:
https://github.com/googlesamples/mediapipe/tree/main/examples/llm_inference/conversion
and the android app to use the converted files:
https://github.com/googlesamples/mediapipe/tree/main/examples/llm_inference/android
You can also dig in there for the tokenizer I suppose.

@farmaker47 @nyadla-sys @freedomtan
I was able to perform fine-tuning using LoRA and conversion to Tensorflow lite of Gemma2 using A100 GPU based on comments in this forum. I am interested in performing inference using the exported tflite in Linux (Colab). However, we need to perform tokenization ourselves (for which I used Gemma Tokenizer from keras_nlp), but the backbone takes only fixed-length input. Thus, how to generate a response from a text prompt using the tflite on Linux (Colab) is not clear to me. Any suggestions on this are welcome.

Hi All, @RageshAntonyHM, if the media-pipe workflow is unideal for your use case we have another option, AI-Edge-Torch, our PyTorch conversion library, you can find more information here: googleblog.
We actually have examples of converting and quantizing decoder-only LLMs here: https://github.com/google-ai-edge/ai-edge-torch/tree/main/ai_edge_torch/generative/examples.
If the conversion is successful, you can also try visualizing the result in model-explorer as well.
Please try them out and let us know if this resolves your issue. If you still need further help, feel free to open a new issue at the respective repo. Thanks for your help.

Hello Everyone, I followed all steps in this issue to create a llm in mobile using gemma-2b-it, but I have a problem when I try to run the llm with mediapipe.
E0000 00:00:1719161438.366071   20510 calculator_graph.cc:887] INTERNAL: CalculatorGraph::Run() failed:
                                                                                Calculator::Open() for node "odml.infra.TfLitePrefillDecodeRunnerCalculator" failed: ; RET_CHECK failure (external/odml/odml/infra/genai/inference/calculators/tflite_prefill_decode_runner_calculator.cc:157) (prefill_runner_)!=(nullptr)

the step that i followed were:

trained the llm with keras.
Convert from keras to tflite.
Convert tflite to mediaPipe. (using colab
load .task in android with mediapipe

does Anybody know something about that error?

Hi @jigmam, if you have your converted model and android studio project please share it. We need the context around the call which is doing the error for us to debug it. Thanks for your help!

Thanks for your response.
I am using react native, this is the repository: https://github.com/jigmam/reactllm.git
the .task is in this link: https://drive.google.com/file/d/1iJW75azdzf1o6LC0-ohAW8g8brohqb7P/view?usp=drive_link
and if you need to know how I created .task,  you can see:

https://github.com/jigmam/reactllm/blob/main/Copia_de_lora_tuning.ipynb
https://github.com/jigmam/reactllm/blob/main/convertidor_de_modelos_funciona_conTPU.ipynb
3.https://colab.research.google.com/github/googlesamples/mediapipe/blob/main/examples/llm_inference/bundling/llm_bundling.ipynb (Note: like a tokenizer.model a download .model from https://huggingface.co/google/gemma-2b-it/tree/main, I know is not a better way but I didnt know how get that tokenizer.model

if you have any questions or suggestions, please let me know.
I am bloking, i dont know what i can do.

Hi @jigmam, while there is probably a way to make mediapipe work with reactnative, I suspect we will keep running into different issues if we go that route (as it's not a well traveled road) -- Would you be open to switching to an Android Studio project? If you are targeting Android: https://ai.google.dev/edge/mediapipe/solutions/setup_android

It's okey for my, I just need MVP to present a prototype. Following your recommendation I created a new project using example that link, but not working .task, could it be a issue in converter between keras to tflite?

Hi @jigmam, currently Keras3 does not work well with tflite primarily due to saved model format issues. What I'm hearing from you is that you were able to follow https://github.com/google-ai-edge/ai-edge-torch/tree/main/ai_edge_torch/generative/examples successfully? If so, great! If not, let us know if you are stuck.

No yet, I am reading the example, several questions: do I need to make fine-tuning again? Is That tutorial just using to convert to pytorch to tflite? Remember  I Made fine-tuning in keras

Hi @jigmam, yes and no depending on what's easier for you. You can reauthor the model in PyTorch, then transfer the weights from Keras to PyTorch.. this is a very manual process and is dependent on the models (from and to), then do the conversion with AI-Edge-Torch. Or you can just reauthor in PyTorch and fine-tune that, then convert that model. Whichever is you feel is easier for you.


nixos/pcscd: fix linking of org.debian.pcsc-lite.policy file for polkit

Description of changes
Before the org.debian.pcsc-lite.policy file wasn't linked at all because the first output was choosen which is bin but we need out to get the file.
Can be verified with tree /run/current-system/sw/share/polkit-1/ | rg pcsc or the reproduced in https://github.com/NixOS/nixpkgs/pull/280995#pullrequestreview-1824167344
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[x] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

Thanks for testing this out. I tested this myself in the yubikey-manager-qt PR, too. So merging

Thanks @SuperSandro2000 :pizza:


rambox: Allow to run with grsecurity kernel

Motivation for this change
Paxmark, so it can run in a hardened environment
Things done

[X] Tested using sandboxing
(nix.useSandbox on NixOS,
or option build-use-sandbox in nix.conf
on non-NixOS)
Built on platform(s)

[X] NixOS
[ ] macOS
[ ] Linux

[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[X] Tested execution of all binary files (usually in ./result/bin/)
[X] Fits CONTRIBUTING.md.

Thanks! I believe things will be easier if I'll have a success adjusting Rambox expression to build it from sources (not a case for Franz which is not open source).


Network stack: net_if cleanup

Various commit to fix #8728 issue.

recheck

@jukkar can you request a recheck? (if it's me it does not work)

can you request a recheck? (if it's me it does not work)

Recheck has not worked for me for long time. Perhaps it has been removed altogether. You need to rebase and force push, or close and re-open this PR.

@jukkar ok I thought it was some access rights issue


[Bug] Some modules have wrong parent pom definition

Search before asking

[X] I searched the issues and found no similar issues.

Linkis Component
linkis-commons, linkis-cg-entrance, linkis-cg-manager, linkis-cg-engineConnplugin, linkis-cg-engineConnManager, linkis-cg-client, linkis-extensions, linkis-orchestrator, linkis-service-gateway, linkis-service-discovery
What happened + What you expected to happen
I found that some sub-modules directly depend on the root pom of linkis and not specific the relative path. So that maven command would throw some fatal problems, like Non-resolvable parent POM for org.apache.linkis:linkis-cs-common:1.1.3: org.apache.linkis:linkis:pom:1.1.3 was not found.
Expect behavior: sub-module depend on its parent module directly. Don't reference across modules.
Relevent platform
All
Reproduction script
Any maven command would reproduce this issue
Anything else
No response
Are you willing to submit a PR?

[X] Yes I am willing to submit a PR!

Thank you, this needs to be unified

I'll fix it ASAP.

According to the discussion in #2497 . This issue will be closed.


How does one call custom environments from outside the environment folder?

Question
Can I access a custom gymnasium environment from outside its directory? This is how I call my gym environment -
import gym_examples
import gym
env = gym.make('gym_examples/GridWorld-v0')
obs = env.reset()
print("obs = ", obs)

I have attached a picture of the structure of my folder. Basically, I am following the instructions given over here - https://gymnasium.farama.org/tutorials/gymnasium_basics/environment_creation/
I already tried this -
import gym_examples
import gym
env = gym.make('my_foo_folder/gym_examples/GridWorld-v0')
obs = env.reset()
print("obs = ", obs)

gym.error.Error: Malformed environment ID: my_foo_folder/gym_examples/GridWorld-v0.(Currently all IDs must be of the form [namespace/](env-name)-v(version). (namespace is optional))

My solution -
In order to call your custom environment from a folder external to that where your custom gym was created, you need to modify the entry_point variable -
from gymnasium.envs.registration import register

register(
     id="gym_examples/GridWorld-v0",
     entry_point="path_to_environment_file:GridWorldEnv",
     max_episode_steps=300,
)

Could someone kindly confirm if this is the right approach? Many thanks!

You need to import your library, which contains your custom env
example:
import gymnasium
import my_library   # contains "my_environment"

env =  gymnasium.make("my_environment")

You will need to include in the my_library/__init__.py the registration code but the code above should work. Let us know if you still have issues


Cannot unregister a HubSite if it's deleted

Category

[x] Bug

Related issue: https://github.com/MicrosoftDocs/office-docs-powershell/issues/662
Expected or Desired Behavior
One of two:

Either deletion of a site should be blocked if it's a hub site or has sites associated to the hub
Deletion of a site should also unregister it as a hub site

Observed Behavior
I get "File not found" when running Unregsiter-SPOHub site on a deleted site.
Steps to Reproduce

Create a new site
Register it as hub site
Delete the site
(empty recycle bin)
Try to run Unregister-SPOHubSite

Thanks for reporting this. This is an unfortunate and known issue which is in the top of mind to get fixed within upcoming weeks. There are no workarounds for this for now.

Thank you and a good thing it's in preview and I can live with the dummy ones on my dev tenant :)

Has this been fixed in the "May 2018 Intermediate Release 1"? If so, i couldn't find a way to remove the old/dummy ones. Did i miss something or isn't this possible yet?

No. We need to update the CSOM version first. In the mean time you can use the latest SPO cmdlets to unregister your hub site.

I have the same problem: I deleted a Hub site without un-registering as a such. Unfortunately I also deleted it from the recycle bin. Will creating a new site with the same URL as the deleted site replace the old Hub registration?

No, use the SPO cmdlet to unregistered it, or wait for the the June PnP release which has a fix.


Add a shell script to validate xml files with CI

We could catch bugs in the generated markup if a script was written to have xmllint validate the generated xml files in various situations, with Travis CI.
Thoughts?

Not a shell script, but we should probably use Nokogiri instead of just regex in our test suite :+1:

Nokogiri is great too.. :smiley:  :+1:

Wait... we have this already

its not a full-blown validation though..

It is validated by the W3 validation service

yet.. we still encountered a bug in the generated feed..
okay, closing this.

We weren't testing for cases where site.lang was set.


[RELAY][PASS] Make Fusor Handle Split Gracefully

Hi folks,
A common pattern in LSTM/GRU-style cells is a structure like (for simplicity):
        rnn_dim = 10
        X = relay.var("X", shape=(1, rnn_dim))
        W = relay.var("y", shape=(3 * rnn_dim, rnn_dim))
        matmul = relay.nn.dense(X, W)
        splitted = relay.split(matmul, indices_or_sections=3, axis=1)
        out = relay.sigmoid(splitted[0]) + relay.tanh(splitted[1]) * relay.exp(splitted[2])

Normally when implementing this in Relay, we'd expect that graph_fuse would fuse this entire sequence (matmul + split + sigmoid/tanh/exp/add/mul) into a single function, as that's entirely reasonable expectation and generates the highest performance code.  That is, we expect:
fn (%X: Tensor[(1, 10), float32],
    %y: Tensor[(30, 10), float32])
    -> Tensor[(1, 10), float32] {
  %0 = nn.dense(%X, %y, units=None) # ty=Tensor[(1, 30), float32]
  %1 = split(%0, indices_or_sections=int64(3), axis=1) # ty=Tuple[Tensor[(1, 10), float32], Tensor[(1, 10), float32], Tensor[(1, 10), float32]]
  %2 = %1.0
  %3 = sigmoid(%2) # ty=Tensor[(1, 10), float32]
  %4 = %1.1
  %5 = tanh(%4) # ty=Tensor[(1, 10), float32]
  %6 = %1.2
  %7 = exp(%6) # ty=Tensor[(1, 10), float32]
  %8 = multiply(%5, %7) # ty=Tensor[(1, 10), float32]
  %9 = add(%3, %8) # ty=Tensor[(1, 10), float32]
  %9
}

Instead, Relay generates something like:
fn (%X: Tensor[(1, 10), float32],
    %y: Tensor[(30, 10), float32])
    -> Tensor[(1, 10), float32] {
  %0 = fn(%p0: Tensor[(1, 10), float32],
          %p1: Tensor[(30, 10), float32])
          -> Tensor[(1, 30), float32] {
    %1 = nn.dense(%p0, %p1, units=None) # ty=Tensor[(1, 30), float32]
    %1
  }
  %2 = %0(%X, %y) # ty=Tensor[(1, 30), float32]
  %3 = fn(%p01: Tensor[(1, 30), float32])
          -> Tuple[Tensor[(1, 10), float32], Tensor[(1, 10), float32], Tensor[(1, 10), float32]] {
    %4 = split(%p01, indices_or_sections=int64(3), axis=1) # ty=Tuple[Tensor[(1, 10), float32], Tensor[(1, 10), float32], Tensor[(1, 10), float32]]
    %4
  }
  %5 = %3(%2) # ty=Tuple[Tensor[(1, 10), float32], Tensor[(1, 10), float32], Tensor[(1, 10), float32]]
  %6 = %5.0
  %7 = %5.1
  %8 = %5.2
  %9 = fn(%p02: Tensor[(1, 10), float32],
          %p11: Tensor[(1, 10), float32],
          %p2: Tensor[(1, 10), float32])
          -> Tensor[(1, 10), float32] {
    %10 = sigmoid(%p02) # ty=Tensor[(1, 10), float32]
    %11 = tanh(%p11) # ty=Tensor[(1, 10), float32]
    %12 = exp(%p2) # ty=Tensor[(1, 10), float32]
    %13 = multiply(%11, %12) # ty=Tensor[(1, 10), float32]
    %14 = add(%10, %13) # ty=Tensor[(1, 10), float32]
    %14
  }
  %15 = %9(%6, %7, %8) # ty=Tensor[(1, 10), float32]
  %15
}

While of course it would be possible to implement a "GateComputation" op or similar which is internally just (split + pointwise functions), but it would be quite elegant to avoid that if possible.
I'm not fluent in the Relay GraphFuser code, but I was hoping someone (@jroesch?) knows off the top of their head what needs to be modified inside the fuser, and I or someone else can do the implementation work.
cc @jroesch, @yidawang, @tqchen

The problem has something to do with the tuple handling, in particular, wrt to the split, which we do not do too well so far, I agree that this should be handled more gracefully.

cc @masahi @kazum who might be interested in this as well.

Thanks @tqchen. For reference, something like this:
def test_dense_split():
    def before():
        rnn_dim = 10
        X = relay.var("X", shape=(1, rnn_dim))
        W = relay.var("y", shape=(3 * rnn_dim, rnn_dim))
        matmul = relay.nn.dense(X, W)
        splitted = relay.split(matmul, indices_or_sections=3, axis=1)
        out = relay.sigmoid(splitted[0]) + relay.tanh(splitted[1]) * relay.exp(splitted[2])
        return relay.Function(relay.ir_pass.free_vars(out), out)

    def expected():
        rnn_dim = 10
        X = relay.var("X", shape=(1, rnn_dim))
        W = relay.var("W", shape=(3 * rnn_dim, rnn_dim))
        matmul = relay.nn.dense(X, W)
        out = matmul * relay.const(1.0, "float32") + relay.const(1.0, "float32")
        splitted = relay.split(matmul, indices_or_sections=3, axis=1)
        out = relay.sigmoid(splitted[0]) + relay.tanh(splitted[1]) * relay.exp(splitted[2])
        outf = relay.Function([X, W], out)

        X = relay.var("X", shape=(1, rnn_dim))
        W = relay.var("W", shape=(3 * rnn_dim, rnn_dim))
        y = relay.Call(outf, [X, W])
        return relay.Function([X, W], y)

    z = before()
    z = relay.ir_pass.infer_type(z)
    zz = relay.ir_pass.fuse_ops(z, opt_level=2)
    zz = relay.ir_pass.infer_type(zz)
    assert not relay.ir_pass.free_vars(zz)
    after = relay.ir_pass.infer_type(expected())
    print(zz.astext())
    print(after.astext())
    assert relay.ir_pass.alpha_equal(zz, after)

Expected IR:

fn (%X: Tensor[(1, 10), float32],
    %W: Tensor[(30, 10), float32])
    -> Tensor[(1, 10), float32] {
  %0 = fn(%X1: Tensor[(1, 10), float32],
          %W1: Tensor[(30, 10), float32])
          -> Tensor[(1, 10), float32] {
    %1 = nn.dense(%X1, %W1, units=None) # ty=Tensor[(1, 30), float32]
    %2 = split(%1, indices_or_sections=int64(3), axis=1) # ty=Tuple[Tensor[(1, 10), float32], Tensor[(1, 10), float32], Tensor[(1, 10), float32]]
    %3 = %2.0
    %4 = sigmoid(%3) # ty=Tensor[(1, 10), float32]
    %5 = %2.1
    %6 = tanh(%5) # ty=Tensor[(1, 10), float32]
    %7 = %2.2
    %8 = exp(%7) # ty=Tensor[(1, 10), float32]
    %9 = multiply(%6, %8) # ty=Tensor[(1, 10), float32]
    %10 = add(%4, %9) # ty=Tensor[(1, 10), float32]
    %10
  }
  %11 = %0(%X, %W) # ty=Tensor[(1, 10), float32]
  %11

Actual IR:
fn (%X: Tensor[(1, 10), float32],
    %y: Tensor[(30, 10), float32])
    -> Tensor[(1, 10), float32] {
  %0 = fn(%p0: Tensor[(1, 10), float32],
          %p1: Tensor[(30, 10), float32])
          -> Tensor[(1, 30), float32] {
    %1 = nn.dense(%p0, %p1, units=None) # ty=Tensor[(1, 30), float32]
    %1
  }
  %2 = %0(%X, %y) # ty=Tensor[(1, 30), float32]
  %3 = fn(%p01: Tensor[(1, 30), float32])
          -> Tuple[Tensor[(1, 10), float32], Tensor[(1, 10), float32], Tensor[(1, 10), float32]] {
    %4 = split(%p01, indices_or_sections=int64(3), axis=1) # ty=Tuple[Tensor[(1, 10), float32], Tensor[(1, 10), float32], Tensor[(1, 10), float32]]
    %4
  }
  %5 = %3(%2) # ty=Tuple[Tensor[(1, 10), float32], Tensor[(1, 10), float32], Tensor[(1, 10), float32]]
  %6 = %5.0
  %7 = %5.1
  %8 = %5.2
  %9 = fn(%p02: Tensor[(1, 10), float32],
          %p11: Tensor[(1, 10), float32],
          %p2: Tensor[(1, 10), float32])
          -> Tensor[(1, 10), float32] {
    %10 = sigmoid(%p02) # ty=Tensor[(1, 10), float32]
    %11 = tanh(%p11) # ty=Tensor[(1, 10), float32]
    %12 = exp(%p2) # ty=Tensor[(1, 10), float32]
    %13 = multiply(%11, %12) # ty=Tensor[(1, 10), float32]
    %14 = add(%10, %13) # ty=Tensor[(1, 10), float32]
    %14
  }
  %15 = %9(%6, %7, %8) # ty=Tensor[(1, 10), float32]
  %15
}

is a test case that I believe should pass if this improvement is implemented.

Related, previously concat was not properly handled and was fixed by this PR https://github.com/dmlc/tvm/pull/2187 likely we need similar thing for split

Ok, this is my favorite topic. I can work on this

We might also want to confirm if the current low-level topi layer already allows the generation of the corresponding fused kernel.

I dont expect we can fuse dense with split in our implementation.

The split can at least be fused into the later stages of element-wise ops. To fuse split into dense, we might want to think a bit deeper about changing some of the fusion rule, in the meanwhile, we should work to enable that in topi level

@tqchen I'm puzzled by the usage of TupleGetItemNode. In src/relay/pass/fuse_ops.cc, we have a visitor which takes TupleGetItemNode, and continues visiting the supposedly inner tuple node.
void VisitExpr_(const TupleGetItemNode* op) final {
    CHECK(graph_.node_map.count(op));
    Node* node = graph_.node_map.at(op);
    this->Update(op->tuple, node, kOpaque);
    ExprVisitor::VisitExpr_(op);
    this->AddNode(op);
  }

But it looks like the visitor does not visit the tuple node after visiting TupleGetItemNode above (this function is never called). In fact, op->tuple in the above snippet seems to be a CallNode, the output of split op in this line.
Is this behavior expected? I'm wondering why we are applying TupleGetItem on a CallNode.

FWIW I realized this also introduces some interesting new ideas for scheduling. Normally in our existing frameworks we do stuff like batching the entire gate computation into a single X * k * D gemm (for k = 3 for GRU, 4 for LSTM, etc).
This has the problem that (once you can fuse with split), that to compute the gate values you inspect at D-strided locations in the output, and that needs some sophistication in terms of scheduling that. It may be probably more natural to instead reorder the single GEMM into vector-width blocked variants (i.e. instead of a (kD, D) matrix you'd reorder it into a ((D // V) x k x V,  D) and then realize it at V-sized locations. Most existing frameworks I know of don't take advantage of this, but conceptually it has the potential to be quite useful.

@masahi in the case of TupleGetItem, the Call will return a value with TupleTyype, in our current case, it updates tuple with opaque which cut off the graph(this was the old behavior). We might be able to generalize this like the way we support concat

@masahi thanks for taking point on this 👍

https://github.com/dmlc/tvm/issues/3039


fix id setting. So that the column define into _id.

Hello.
id settings is understanding of the following?
embulk setting
out:
  type: elasticsearch
  id: id
  nodes:
    - {host: localhost, port: 9300}
  index: search
  index_type: product

input value
{
    id: 1,
    name: 'toyama',
    user_name: 'toyama0919'
}

elasticsearch output
{
    "_index": "search",
    "_type": "product",
    "_id": "1",
    "_score": 1.0,
    "_source": {
        id: 1,
        name: 'toyama',
        user_name: 'toyama0919'
    }
}

This PR is It works correctly.

Thanks for your contribution.
I fixed conflict of code, and merged at #14.


possible to specify host-ip?

Hi,
i am experimenting with docker-containers... I currently have multiple containers running on a single host with a hub. Running a test seems to work fine an gives me a video-link on the hub-webpage.
Problem is, this link points to the internal ip of the container that is not reachable from the outside.
Is there a way to specify the ip manually?

Have you tried to expose ports? Expose 3000 and you should be able to see it.
Other option is to mount a host folder as a drive in container and save videos to that.
Do you mind sharing code for docker compose? I'd love to post it for everyone to use
Sent via Payphone

On Feb 5, 2016, at 5:52 PM, Roman<EMAIL_ADDRESS>wrote:
Hi,
i am experimenting with docker-containers I currently have multiple containers running on a single host with a hub Running a test seems to work fine an gives me a video-link on the hub-webpage
Problem is, this link points to the internal ip of the container that is not reachable from the outside
Is there a way to specify the ip manually?
—
Reply to this email directly or view it on GitHub.

Yes, and it is not a problem with exposing ports.
Now on the next day i am not entirely sure this can be fixed.. (it's really hard to get a grasp on it with the current state of documentation, esp. cmdline-args like specifying ip/port..) but anyways..
The setup currently looks like this:
On the remote host a haproxy is dynamically (consul/registrator-setup) forwarding to the (private) container-ip/port:
...
haproxy:
  image: my.own.registry/haproxy:latest
  cpu_shares: 10
  mem_limit: 256m
  restart: always

  ports:
    - "80:80"
    - "443:443"
    - "1936:1936"
    - "3000:3000"
    - "3001:3001"
    - "3002:3002"
    - "3003:3003"

  links:
    - consul:consul

  volumes:
    - /srv/haproxy:/usr/local/etc/haproxy/

# Selenium-Grid
selhub:
  image: my.own.registry/selhub:latest

  ports:
    - 4444:4444

selnodeff:
  image: my.own.registry/selnodeff:latest
  ports:
    - 5901:5900
  links:
    - selhub:hub

selnodeff-esr:
  image: my.own.registry/selnodeff-esr:latest
  ports:
    - 5902:5900
  links:
    - selhub:hub

selnodechrome:
  image: my.own.registry/selnodechrome:latest
  ports:
    - 5903:5900
  links:
    - selhub:hub

Now... most parts work as expected, i can browse the hub/console and every other container by the hosts IP and the port exported by haproxy ( haproy forwards 3001 -> selnodeff:3000 etc..).
Running a test also works ( i checked via vnc).
But the video-link that appears on the hub or on the containers-website contains the private ip of the container (172.x.x.x) which of course is unreachable from a remote.

I just ran into this problem. In your node configuration you'll have to specify the NODE_IP or some other environment variable from the host.
For example in node_5555.json:
"port": 9048,

"host": "<IP_ADDRESS>",
"register": true,


When i use gen_roi_msrvtt.py get some problems

When I run to get the return information from predictor.resize().
"RuntimeError: requested resize to (320, 240) ((320, 240) elements in total), but the given tensor has a size of 1024 (1024 elements). autograd's resize can only change the shape of a given tensor, while preserving the number of elements. "
Could you please tell me the resolution of the frame you are using?
Is this my personal problem? I don't seem to see anyone else having this problem.

Hi, did you modify the output of resnet? The output is expected to be a vector (e.g., 1024-dim) from a fc-layer. You can check the maskrcnn_code.zip in Google drive for reference.

yeah, I reset the code to before the modification, it seems that there is no such problem. I will try again.  Thanks.

Hi, did you modify the output of resnet? The output is expected to be a vector (e.g., 1024-dim) from a fc-layer. You can check the maskrcnn_code.zip in Google drive for reference.


Add RAW support

Write a delta table into CDF as a RAW table
Same pattern as with Events.

Verified that I was able to populate test data from my lakehouse into raw storage:


Content Security Policies clash with new Function

Places like the Chrome Store have a pretty strict Content Security Policies setting, that throw an unsafe-eval error when encountering things like eval and new Function.
@SlexAxton How hard would it be to replace these new Function calls with alternatives?

@SlexAxton may give you a proper response... But, a suggestion is to precompile your formatters during build time and to deploy only these runtime functions.

Yea, I believe all new Function and eval work is done in development mode. The precompilation step will remove the entire compiler from your runtime, as well as remove any need for eval or new Function

(I use messageformat.js in a very locked down CSP environment, currently)

Aah right right. I'll close this.
I came across this problem while using globalize, so @rxaviers could you give me some hints on how to precompile my translations? Globalize.messageFormatter seems to compile at runtime: https://github.com/jquery/globalize/blob/fe14f5b1ccd14ee9af9bf0eb903d758f3d54973f/src/message.js#L93

@unindented, absolutely. Globalize automates that for you (as soon as #398 lands :smile: - probably this week). I will post two examples there, one using webpack and another one using AMD+r.js.

That's great news. Thank you so much @rxaviers!


add zIndex in marker  and cloudMapId for map style (google map style)

add zIndex in marker  and cloudMapId for map style (google map style)
Pre-launch Checklist

[ ] I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
[ ] I updated CHANGELOG.md to add a description of the change.
[ ] I updated/added relevant documentation (doc comments with ///).
[ ] I added new tests to check the change I am making if a test is possible.
[ ] All existing and new tests are passing.

i also enable to use flutter_map in this repo

i also enable to use flutter_map in this repo

I noticed indeed. We created a new setup, which introduced a lot of conflicts here, but that makes it possible to only add flutter_map if you want to.
When do you think using flutter_map makes most sense? On all non-mobile platforms? (web, macos, windows, linux)


Select Default Shell shows up in yarn web

Running it gives this error which is expected, we should not show the command when no process support exists.
ERR NotSupported: Error: NotSupported
	at WorkerExtHostTerminalService.$getAvailableShells (http://localhost:8081/static/out/vs/workbench/api/common/extHostTerminalService.js:624:19)
	at RPCProtocol._doInvokeHandler (http://localhost:8081/static/out/vs/workbench/services/extensions/common/rpcProtocol.js:348:27)
	at RPCProtocol._invokeHandler (http://localhost:8081/static/out/vs/workbench/services/extensions/common/rpcProtocol.js:333:45)
	at RPCProtocol._receiveRequest (http://localhost:8081/static/out/vs/workbench/services/extensions/common/rpcProtocol.js:260:32)
	at RPCProtocol._receiveOneMessage (http://localhost:8081/static/out/vs/workbench/services/extensions/common/rpcProtocol.js:188:26)
	at http://localhost:8081/static/out/vs/workbench/services/extensions/common/rpcProtocol.js:69:52
	at Emitter.fire (http://localhost:8081/static/out/vs/base/common/event.js:479:38)
	at MessagePort.ExtensionWorker.channel.port1.onmessage (http://localhost:8081/static/out/vs/workbench/services/extensions/worker/extensionHostWorker.js:76:25)

The option still seems to show up for me when I ran yarn web on the latest distro.

Ah, the fix got eaten by a merge conflict


Pub Sub Client and firewalls

Are there any special network considerations when using the pub sub dotnet client?
I'm using the latest dotnet clients for pub sub and storage. With the storage client (e.g. StorageClient.UploadObject) all goes well on the company LAN, but with the pub sub client, the methods just hangs (e.g. PublisherClient.Publish). No traffic is seen in Fiddler, and it eventually times out.
If I invoke the pub sub REST API through Postman it works fine.
If I use the pub sub client outside the company LAN it works fine.

StorageClient uses HTTP/1.1, whereas PublisherClient uses gRPC, which uses HTTP/2.0 as the transport. My guess is that your company is running a proxy which can cope with HTTP/1.1 but not HTTP/2.0.
Rather than using Fiddler (which may also not handle HTTP/2.0 properly), try using Wireshark and you should see the attempt to connect.

Thanks! I will check what our proxy supports, but I suspect you are right (even if I couldn't see any http/2 traffic in Wireshark - but that is most likely an end-user issue issue) . Do you know if these clients will align towards the same plumbing in the near future? Can I expect StorageClient to move over to gRPC or the other way around (if that makes any sense)?

The current Storage and BigQuery packages will always use HTTP/1.1 as that's all that's supported at the moment. If and when those APIs are exposed over gRPC, we will create new packages (using the same codegen used for Datastore, Logging, Monitoring, Speech, Vision etc) at that point. I'd expect that to be in a package called Google.Storage.V2 or similar - it will not just be a version number update in the existing package. (The "V1" in Google.Storage.V1 is part of the package name itself, and is in the namespace.)

Thanks for the clarifications! I found out that our proxy should support http/2, and I can see that http/2 (or h2) is used as a protocol (in chrome dev tools) when pointing to google.com. I guess it must be blocked somewhere else. I'll close this one of since it most likely is an infrastructure issue. Thanks for the quick response!


Input is mutated

Input that is passed into the conjugator is mutated because of the use of concat. This causes unexpected errors if the same input is used later and expected to be the original value.
> verb = 'like'

> Verbs::Conjugator.conjugate(
  verb,
  tense:   :past,
  aspect:  :perfective
)
=> "liked"

> verb
=> "liked"

@dwbutler — thanks for this. Are you interested in submitting a PR? Even just a failing test would be excellent if you don't have time for the fix.

Sure, I can take a stab at it.

Closing in favor of #18


Add ability to automatically approve requests based on criteria

Description
When running a Jellyseerr server for other people, you may not want all their requests to be automatically approved. Or you may want to enforce certain settings for certain requests (like specific root folders or quality profiles for specific types of movies or series)
For these reasons, it would be nice to be able to further restrict auto-approval, or even make the auto-approval process modify requests according to the admin's wishes.
Desired Behavior
I'd like the ability to define rules with a number of conditions, to be automatically checked whenever a user submits a new request. If a request fulfills all the conditions of a rule, that request would be approved.
Conditions could for example be genre, release year, number of seasons (requested), which user made the request, etc.
Possibly, the rules could also dictate certain parts of the request, such as the destination server, quality profiles, root folders, or tags.
Additional Context
I've already done some work, to better illustrate my vision. I did this with Overseerr, but seeing as Jellyseerr seems to be considerably more active in development, I figured it a better fit. Currently it's mostly UI, but implementing the logic seems like the logical (heh) next step to me. I've provided some screenshots (from Overseerr) below:
List of defined approval rules:

Editing an auto-approval rule:

Modifying the wanted value of a condition

I'd love to continue working on this, but with my limited experience (especially with frontend), I feel I've reached a point where I would need to discuss it with others to see the path ahead.
Code of Conduct

[X] I agree to follow Jellyseerr's Code of Conduct

You could also open a PR here, and mark it as draft PR, so people can see what work have you done

Yup, I can do that. I just figured I'd throw it up as an issue first to see what the interest/thoughts were. Especially since I've been doing this based on Overseerr, so it'll take a bit of time/effort to move over to Jellyseerr. I'll get on it right away.


[Snyk] Security upgrade python from 3.7-slim to 3.13.0a3-slim

This PR was automatically created by Snyk using the credentials of a real user.Keeping your Docker base image up-to-date means you’ll benefit from security fixes in the latest version of your chosen image.
Changes included in this PR

terraform/aws/resources/Dockerfile

We recommend upgrading to python:3.13.0a3-slim, as this image has only 43 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.
Some of the most important vulnerabilities in your base image include:

Severity
Priority Score / 1000
Issue
Exploit Maturity

829
Out-of-bounds Write SNYK-DEBIAN12-GLIBC-5927132
Mature

829
Out-of-bounds Write SNYK-DEBIAN12-GLIBC-5927132
Mature

721
Out-of-bounds Write SNYK-DEBIAN12-GLIBC-6210098
Proof of Concept

721
Out-of-bounds Write SNYK-DEBIAN12-GLIBC-6210098
Proof of Concept

614
Out-of-bounds Write SNYK-DEBIAN12-PERL-6085273
No Known Exploit

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
🛠 Adjust project settings

Learn how to fix vulnerabilities with free interactive lessons:
🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

Checkmarx One – Scan Summary & Details – 2f5eb167-7ebc-4312-af8e-c8e642e2a001
New Issues

Severity
Issue
Source File / Package
Checkmarx Insight

CVE-2022-42004
Maven-com.fasterxml.jackson.core:jackson-databind-2.12.4
Vulnerable Package

Missing User Instruction
/Dockerfile: 1
A user should be specified in the dockerfile, otherwise the image will run as root

Healthcheck Instruction Missing
/Dockerfile: 1
Ensure that HEALTHCHECK is being used. The HEALTHCHECK instruction tells Docker how to test a container to check that it is still working

Fixed Issues

Severity
Issue
Source File / Package

Missing User Instruction
/Dockerfile: 1

Healthcheck Instruction Missing
/Dockerfile: 1


Crash when closing a scene tab with middle click

Godot version
4.0.dev (8b79a1942)
System information
Linux
Issue description
Traceback:
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.alpha.custom_build (8b79a19426c7f5eab04caa573866276c76c70871)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x38a40) [0x7faa4348fa40] (??:0)
[2] godot(__dynamic_cast+0x4f) [0x55d56ae15e8f] (??:0)
[3] Node* Object::cast_to<Node>(Object*) (??:0)
[4] VariantObjectClassChecker<Node*>::check(Variant const&) (??:0)
[5] VariantCasterAndValidate<Node*>::cast(Variant const**, unsigned int, Callable::CallError&) (??:0)
[6] void call_with_variant_args_helper<SceneTreeEditor, Node*, 0ul>(SceneTreeEditor*, void (SceneTreeEditor::*)(Node*), Variant const**, Callable::CallError&, IndexSequence<0ul>) (??:0)
[7] void call_with_variant_args<SceneTreeEditor, Node*>(SceneTreeEditor*, void (SceneTreeEditor::*)(Node*), Variant const**, int, Callable::CallError&) (??:0)
[8] CallableCustomMethodPointer<SceneTreeEditor, Node*>::call(Variant const**, int, Variant&, Callable::CallError&) const (??:0)
[9] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (??:0)
[10] MessageQueue::_call_function(Callable const&, Variant const*, int, bool) (??:0)
[11] MessageQueue::flush() (??:0)
[12] SceneTree::physics_process(double) (??:0)
[13] Main::iteration() (??:0)
[14] OS_LinuxBSD::run() (??:0)
[15] godot(main+0x187) [0x55d5661a7250] (??:0)
[16] /usr/lib/libc.so.6(+0x232d0) [0x7faa4347a2d0] (??:0)
[17] /usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7faa4347a38a] (??:0)
[18] godot(_start+0x25) [0x55d5661a6ff5] (??:0)
-- END OF BACKTRACE --
================================================================

The issue persists after I deleted the .godot folder.
EDIT: I'm currently investigating, it seems to have to do with _test_update_tree.
EDIT 2: I tracked it down to a deferred signal callback to update_configuration_warning where the node is null when the callback is executed.
Steps to reproduce

Open a project with multiple tabs open
Middle click on a scene tab
Crash

Minimal reproduction project
No response

I tried to recreate this on my machine by building the current source code and this does not crash for me. I'm running Arch 5.15.64-1-lts.
Tested on my main game project with multiple files and on a new project. Everything works fine for me.

This fixes the issue:
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 137574640e..e1509a0b25 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -835,7 +835,7 @@ void SceneTreeEditor::_notification(int p_what) {
                        get_tree()->connect("tree_process_mode_changed", callable_mp(this, &SceneTreeEditor::_tree_process_mode_changed));
                        get_tree()->connect("node_removed", callable_mp(this, &SceneTreeEditor::_node_removed));
                        get_tree()->connect("node_renamed", callable_mp(this, &SceneTreeEditor::_node_renamed));
-                       get_tree()->connect("node_configuration_warning_changed", callable_mp(this, &SceneTreeEditor::_warning_changed), CONNECT_DEFERRED);
+                       get_tree()->connect("node_configuration_warning_changed", callable_mp(this, &SceneTreeEditor::_warning_changed));

                        tree->connect("item_collapsed", callable_mp(this, &SceneTreeEditor::_cell_collapsed));


Pux backend

Hopefully this code is fairly self-contained, it should be easy to adapt to any typed language where the event is a threaded type parameter (forall ev. Html ev).
This will be slow-ish at runtime. If this is observable and unacceptable, there are plenty of remedies available. Swapping out the runtime Array for an ST-based array builder, that should pretty much do it.
All current codebases compile fairly quickly with one exception: those Int and Double types defined somewhere in manor.
! @charleso @sphvn

💯
Legend


聊天室turms-service对外提供http接口如何设置超时时间？

我这样进行设置没有效果呢

对外提供的http接口，怀疑没有设置超时时间，导致系统的fd一直增加

The latest server images and code on both develop and master now provide the following properties that you can use to configure timeouts:

turms.service.admin-api.http.request-read-timeout-millis: The read timeout on the connection when it is waiting for an HTTP request to be fully read. Once the timeout is reached, the connection will be closed.
turms.service.admin-api.http.idle-timeout-millis: The idle timeout on the connection when it is waiting for an HTTP request to come. Once the timeout is reached, the connection will be closed.
turms.service.admin-api.http.connect-read-timeout-millis: The connect timeout.


Update ssl-performance docs

Update SSL performance docs to reflect BoringSSL in wheels.
This updates the use of python with BoringSSL based on https://github.com/grpc/grpc/pull/23483#pullrequestreview-461186568
@lidizheng

@lidizheng anything else you would like me to do on this?

Sorry. This fell of my radar. I thought I merged long ago. Merging.


Import blocks after plugins are loaded.

All persist plugins need to be loaded before blocks start importing.
Depends on neo-project/neo/pull/633

This also still references NuGet CI build, thus waiting to merge.


Timeout issue

I am using Moroen's python plugin for domoticz which uses the pytradfri library
I have everying (coap, pytradfri, plugin) updated to the latest versions.
The issue I face is that, after a while, I can no long access the gateway and get a timeout error (ERROR:root:Error in initGateway: Request timeout) even though the gateway is pingable and the IKEA app has no issues with it (connevts and I can switch devices). Generating a new key pair also times out.
Power cycling the bridge makes it return to 'normal'.
The bridge is running the latest 1.10.1 firmware.
Any idea what is causing this?

Please see this in the readme: https://github.com/ggravlingen/pytradfri#known-issues

Understood. Three thing is that I have had the plugin running for quite a while with no issues at all until recently. It's as if the newer firmware creates issues... That's why I wondered if moving the hub would make any difference since there were no problems before and only the firmware changed.

Unfortunately, there's nothing that can be done from our side here. Closing the issue.


chore: use @sofie-automation/code-standard-preset in packages

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Code quality
This is applying the code-standard-preset to the packages moved into this repo in r28.
Some work required to get everything to be happy.

Other information:

Status

[ ] Code documentation for the relevant parts in the code have been added/updated by the PR author
[ ] The functionality has been tested by the PR author
[ ] The functionality has been tested by NRK

Codecov Report

Merging #379 (aa0e9de) into release28 (1d4f207) will increase coverage by 0.01%.
The diff coverage is 88.71%.

@@              Coverage Diff              @@
##           release28     #379      +/-   ##
=============================================
+ Coverage      69.19%   69.20%   +0.01%
=============================================
  Files            210      210
  Lines          14054    14053       -1
  Branches        3308     3321      +13
=============================================
+ Hits            9725     9726       +1
+ Misses          4157     4156       -1
+ Partials         172      171       -1

Impacted Files
Coverage Δ

packages/server-core-integration/src/index.ts
100.00% <ø> (ø)

.../server-core-integration/src/lib/coreConnection.ts
75.67% <80.39%> (+0.28%)
:arrow_up:

...kages/server-core-integration/src/lib/ddpClient.ts
75.83% <80.64%> (ø)

...ckages/server-core-integration/src/lib/timeSync.ts
80.88% <82.60%> (+2.00%)
:arrow_up:

...es/server-core-integration/src/lib/ddpConnector.ts
91.46% <88.88%> (+1.10%)
:arrow_up:

.../server-core-integration/src/lib/configManifest.ts
100.00% <100.00%> (ø)

...server-core-integration/src/lib/corePeripherals.ts
100.00% <100.00%> (ø)

packages/server-core-integration/src/lib/queue.ts
100.00% <100.00%> (ø)

packages/server-core-integration/src/lib/random.ts
100.00% <100.00%> (ø)

...ckages/server-core-integration/src/lib/watchDog.ts
79.48% <100.00%> (ø)

... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4f207...aa0e9de. Read the comment docs.

This is rather stale and very low priority so is unlikely to be touched soon.
I shall leave the branch in case it is a useful base for someone else wanting to complete this task


MySQL problem

Hello, I made another PaperSpigot server (using Waterfall) authlobby.
Each server have no problem with connecting to MySQL luckperms, but this has.
I read that site with Storage System errors... Iam sure, that everything is set-up right.
Error:
https://paste.hostify.cz/?9605c8a39567b44e#9Fot6zaK5yEmTtdSi6G9vtqcftz5fiAukuJcJ5zftdfi

the error just means something wrong with the following listed on the Storage System errors wiki. Usually there isn't much LuckPerms can do, since it's up to your network, database setup and/or inputting correct database information for it to work.


Truly treat multiple certs with the same SAN as a warning

@zwoop #8308 is the cherry-pick for 9.1.x


Remove a bunch of dead code

This code does nothing and should be removed. Please review and merge.

Coverage increased (+0.04%) to 34.654% when pulling 01c9000a52f984b878b2bdcca26be77f9625c66c on TS_remove_dead_code into cd82c82d75066f315230a4a51a16ffca29d52234 on master.


Is it possible to get prediction detail for each label in RunModelOnImage method?

is it possible to get prediction detail for each label in RunModelOnImage ?
for example output like:
{
output : [
{
index: 0,
label: "person",
confidence: 0.65
},
{
index: 1,
label: "car",
confidence:0.15,
},
{
index: 2,
label: "bicycle",
confidence: 0.2"
}
]
}
Thanks

Hello!
You could try to ask for as many results as labels you have. For example, if you have 3 labels ask for 3 results:
    var recognitions = await Tflite.runModelOnImage(
  path: image.path,
  numResults: 3,
   threshold: 0.05,
   imageMean: 127.5,
  imageStd: 127.5,
  );
Hope it works!

Hello!
You could try to ask for as many results as labels you have. For example, if you have 3 labels ask for 3 results:
 var recognitions = await Tflite.runModelOnImage(
 path: image.path,
 numResults: 3,
 threshold: 0.05,
 imageMean: 127.5,
 imageStd: 127.5,
 );
Hope it works!

Thanks for answering, apreciate it,
I already ask for 3 result but still get the same output, which not resulting output like in my question.
here's my code :
static Future classifyImage(File image) async {     final output = await Tflite.runModelOnImage(       path: image.path,       numResults: 3,       threshold: 0.5,       imageMean: 127.5,       imageStd: 125.5,     );     return output;   }
and the output :
[{confidence: 1.0, index: 2, label: pneumonia}]

You can lower your minimal confidence/threshold, 0.0 will return everthing.