TypeError: Cannot read properties of undefined (reading 'cacheItemsMap')

Stack Trace:
TypeError: Cannot read properties of undefined (reading 'cacheItemsMap')
    at IEffectTotal.effect (file:///Users/rico/projects/trebeljahr.com/node_modules/@contentlayer/source-files/src/fetchData/index.ts:187:19)
    at FiberContext.evaluateNow (file:///Users/rico/projects/trebeljahr.com/node_modules/@effect-ts/system/_src/Fiber/context.ts:940:54)
    at file:///Users/rico/projects/trebeljahr.com/node_modules/@effect-ts/system/_src/Fiber/context.ts:576:33
    at file:///Users/rico/projects/trebeljahr.com/node_modules/@effect-ts/system/_src/Support/Scheduler/index.ts:15:9
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Fiber: #45 (started at: 2024-03-07T20:33:17.184Z) was supposed to continue to: <empty trace>

Fiber: #45 (started at: 2024-03-07T20:33:17.184Z) Execution trace: <empty trace>

Fiber: #45 (started at: 2024-03-07T20:33:17.184Z) was spawned by:

Fiber: #41 (started at: 2024-03-07T20:33:17.184Z) was supposed to continue to: <empty trace>

Fiber: #41 (started at: 2024-03-07T20:33:17.184Z) Execution trace: <empty trace>

Fiber: #41 (started at: 2024-03-07T20:33:17.184Z) was spawned by:

Fiber: #40 (started at: 2024-03-07T20:33:17.183Z) was supposed to continue to: <empty trace>

Fiber: #40 (started at: 2024-03-07T20:33:17.183Z) Execution trace: <empty trace>

Fiber: #40 (started at: 2024-03-07T20:33:17.183Z) was spawned by:

Fiber: #39 (started at: 2024-03-07T20:33:17.141Z) was supposed to continue to: <empty trace>

Fiber: #39 (started at: 2024-03-07T20:33:17.141Z) Execution trace: <empty trace>

Fiber: #39 (started at: 2024-03-07T20:33:17.141Z) was spawned by:

Fiber: #34 (started at: 2024-03-07T20:33:17.133Z) was supposed to continue to: <empty trace>

Fiber: #34 (started at: 2024-03-07T20:33:17.133Z) Execution trace: <empty trace>

Fiber: #34 (started at: 2024-03-07T20:33:17.133Z) was spawned by:

Fiber: #32 (started at: 2024-03-07T20:33:17.133Z) was supposed to continue to: <empty trace>

Fiber: #32 (started at: 2024-03-07T20:33:17.133Z) Execution trace: <empty trace>

Fiber: #32 (started at: 2024-03-07T20:33:17.133Z) was spawned by:

Fiber: #26 (started at: 2024-03-07T20:33:17.126Z) was supposed to continue to: <empty trace>

Fiber: #26 (started at: 2024-03-07T20:33:17.126Z) Execution trace: <empty trace>

Fiber: #26 (started at: 2024-03-07T20:33:17.126Z) was spawned by:

Fiber: #5 (started at: 2024-03-07T20:33:16.823Z) was supposed to continue to: <empty trace>

Fiber: #5 (started at: 2024-03-07T20:33:16.823Z) Execution trace: <empty trace>

Fiber: #5 (started at: 2024-03-07T20:33:16.823Z) was spawned by:

Fiber: #0 (started at: 2024-03-07T20:33:16.808Z) was supposed to continue to: <empty trace>

Fiber: #0 (started at: 2024-03-07T20:33:16.808Z) Execution trace: <empty trace>

Fiber: #0 (started at: 2024-03-07T20:33:16.808Z) was spawned by: <empty trace>

OS: darwin 23.3.0 (arch: arm64)
Process: /Users/rico/.nvm/versions/node/v20.11.0/bin/node /Users/rico/projects/trebeljahr.com/node_modules/next/dist/server/lib/start-server.js
Node version: v20.11.0
Contentlayer version: 0.3.4

I'm not sure if this is at all related but for me or even if it might be fixed in a newer version or something but some of the generated .mjs files seem to be wrong too, where contentlayer seems to be having problems with ' characters in the file names, creating invalid .js code that looks like this for some imports.
import notes__diaryEntries__06_01_2023FridayAiMeaninglessnessHoldingBackPivotingPlansAndSchindlerSListMd from './Notes__Diary Entries__06.01.2023 – Friday - AI Meaninglessness, Holding Back, Pivoting Plans, and Schindler's List.md.json' assert { type: 'json' }

sorry for the messy long file names I am just trying to import notes from my Obsidian diary right now to see if I can play around with them in next.js and publish some of them ^^
also if this is another issue/separate from the stack trace above, I can open another one ^^


dev.boringcrypto: 1.16.8b7 release

1.16.8 has a security fix. What is the ETA for 1.16.8b7?
https://github.com/golang/go/issues/47985
Thanks again for maintaining this great branch!
@katiehockman @FiloSottile

Jeremy Faller has provided an update on a (tangentially) related thread on golang-dev:

We had a small snafu with boringcrypto, as we're transferring responsibilities for it's maintenance around internally. This branch will be updated with the next point release for Golang. Following our published process, unless a security release causes rescheduling, that next point release will happen this week, and boringcrypto will be updated soon after now that we've sorted out responsibilities.

I'm closing here since I don't think we need an issue to track the boringcrypto work (it's internal to Google I believe, and traditionally there never was a github issue).

@ALTree we've filed dec.bordingcrypto issues in the GitHub project before. If this is not the proper communication channel, what would be the proper way to communicate on that branch?

This is definitely the right place to report bugs in the boringcrypto branches.
What I mean is that the boringcrypto releases will happen regardless, so strictly speaking is not necessary to ask for them by opening github issues. And the other way around: if no one is able to work on them at a given moment, they won't happen, regardless of any github issue asking for a release.
I understand the boringcrypto release schedule (if there's one) is not well documented; #48043 tracks this.


Fixed #32208 -- fixed misinterpretation of "proxy" as TypeError.

tweaked exception handling of add built in filter , to support (gettext
_lazy). as previously it was taking it as a TypeError and used to
return a string.

@Blackeyeforreal You don't need to open a new PR for each change. You can push commits to an opened PR.

@Blackeyeforreal You don't need to open a new PR for each change. You can push commits to an opened PR.
thanks, i was wondering how it can so inconvenient.

I had thought about another approach where we would add str() of each value in case of exceptions. However this would be slightly backwards incompatible because previously 5|add:'string' would have returned an empty string while the new approach would produce 5string. However counting on type errors to produce an empty result doesn't look very solid, so I'd be tempted to go and document the backwards incompatibility. @felixxm, thoughts?
Then I also think we should explore this:
diff --git a/django/utils/functional.py b/django/utils/functional.py
index 6d38f932f9..5c8a0c233f 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -176,6 +176,12 @@ def lazy(func, *resultclasses):
                 return str(self) % rhs
             return self.__cast() % rhs

+        def __add__(self, other):
+            return self.__cast() + other
+
+        def __radd__(self, other):
+            return other + self.__cast()
+
         def __deepcopy__(self, memo):
             # Instances of this class are effectively immutable. It's just a
             # collection of functions. So we don't need to do anything
diff --git a/tests/template_tests/filter_tests/test_add.py b/tests/template_tests/filter_tests/test_add.py
index 0fcc661f4a..dc765b37ee 100644
--- a/tests/template_tests/filter_tests/test_add.py
+++ b/tests/template_tests/filter_tests/test_add.py
@@ -46,6 +46,21 @@ class AddTests(SimpleTestCase):
         output = self.engine.render_to_string('add07', {'d': date(2000, 1, 1), 't': timedelta(10)})
         self.assertEqual(output, 'Jan. 11, 2000')

+    @setup({'add08': '{{ s1|add:lazy_s2 }}'})
+    def test_add08(self):
+        from django.utils.translation import gettext_lazy
+        output = self.engine.render_to_string('add08', {'s1': 'string', 'lazy_s2': gettext_lazy('lazy')})
+        self.assertEqual(output, 'stringlazy')
+
+    @setup({'add09': '{{ lazy_s1|add:lazy_s2 }}'})
+    def test_add09(self):
+        from django.utils.translation import gettext_lazy
+        output = self.engine.render_to_string(
+            'add09',
+            {'lazy_s1': gettext_lazy('string'), 'lazy_s2': gettext_lazy('lazy')}
+        )
+        self.assertEqual(output, 'stringlazy')
+

 class FunctionTests(SimpleTestCase):

I had thought about another approach where we would add str() of each value in case of exceptions. However this would be slightly backwards incompatible because previously 5|add:'string' would have returned an empty string while the new approach would produce 5string. However counting on type errors to produce an empty result doesn't look very solid, so I'd be tempted to go and document the backwards incompatibility. @felixxm, thoughts?

I'm not sure about this approach, casting to str can create an unexpected results, e.g. 'string'|add:None will return stringNone.

Then I also think we should explore this:
...

This looks nice.

I had thought about another approach where we would add str() of each value in case of exceptions. However this would be slightly backwards incompatible because previously 5|add:'string' would have returned an empty string while the new approach would produce 5string. However counting on type errors to produce an empty result doesn't look very solid, so I'd be tempted to go and document the backwards incompatibility. @felixxm, thoughts?
Then I also think we should explore this:
diff --git a/django/utils/functional.py b/django/utils/functional.py
index 6d38f932f9..5c8a0c233f 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -176,6 +176,12 @@ def lazy(func, *resultclasses):
                 return str(self) % rhs
             return self.__cast() % rhs

+        def __add__(self, other):
+            return self.__cast() + other
+
+        def __radd__(self, other):
+            return other + self.__cast()
+
         def __deepcopy__(self, memo):
             # Instances of this class are effectively immutable. It's just a
             # collection of functions. So we don't need to do anything
diff --git a/tests/template_tests/filter_tests/test_add.py b/tests/template_tests/filter_tests/test_add.py
index 0fcc661f4a..dc765b37ee 100644
--- a/tests/template_tests/filter_tests/test_add.py
+++ b/tests/template_tests/filter_tests/test_add.py
@@ -46,6 +46,21 @@ class AddTests(SimpleTestCase):
         output = self.engine.render_to_string('add07', {'d': date(2000, 1, 1), 't': timedelta(10)})
         self.assertEqual(output, 'Jan. 11, 2000')

+    @setup({'add08': '{{ s1|add:lazy_s2 }}'})
+    def test_add08(self):
+        from django.utils.translation import gettext_lazy
+        output = self.engine.render_to_string('add08', {'s1': 'string', 'lazy_s2': gettext_lazy('lazy')})
+        self.assertEqual(output, 'stringlazy')
+
+    @setup({'add09': '{{ lazy_s1|add:lazy_s2 }}'})
+    def test_add09(self):
+        from django.utils.translation import gettext_lazy
+        output = self.engine.render_to_string(
+            'add09',
+            {'lazy_s1': gettext_lazy('string'), 'lazy_s2': gettext_lazy('lazy')}
+        )
+        self.assertEqual(output, 'stringlazy')
+

 class FunctionTests(SimpleTestCase):

well code seams to be handling the new test case (ie add08 and add 09) fine, although i think it would be nice if we add it, as a precaution. But i know it is gonna sound silly but how do i push changes in this pull request.
also how do i get this reviewed , should i wait for someone to look at it , or should i tag someone .

Hi there, you can push new commits to the branch you used to open the pull request, in your case, ticket_99999.
git push origin ticket_99999

Does that help?
For reviews, you don't need to tag anyone. The most you need to do is keep an eye on the ticket flags and make sure if anyone sets "Needs ..." that you uncheck it when you're ready for a review.

Superseded by #13794


exmaple scene broken

Failed to create Physics Mesh from source mesh. One of the triangles is too large. It's recommended to tesselate the large triangles. Source mesh name: Plattform_01
—
at bool UnityEditor.SceneManagement.EditorSceneManager.ReloadScene(Scene scene)
void UnityEditor.SceneHierarchy.DiscardChangesInSelectedScenes(object userData)
void UnityEditor.GenericMenu.CatchMenu(object userData, string[] options, int selected)

Hey, apologies for the delayed response. Could you provide more details on where or how exactly this issue occurs? The example scene runs perfectly fine on my end with a fresh install of Unity 2<IP_ADDRESS>. I suspect the issue might relate to the scale of the platforms in the example scene. However, if it doesn't break anything, my inclination is to leave it as is for now.


Constraint error when tuning with AutoNHITS

What happened + What you expected to happen
When tuning AutoNHITS with Optuna backend (without using Ray Tune) I occasionally get this error:
neuralforecast/lib64/python3.8/site-packages/torch/distributions/distribution.py", line 68, in __init__
    raise ValueError(
ValueError: Expected parameter df (Tensor of shape (1024, 31)) of distribution Chi2() to satisfy the constraint GreaterThan(lower_bound=0.0), but found invalid values:
tensor([[nan, nan, nan,  ..., nan, nan, nan],
        [nan, nan, nan,  ..., nan, nan, nan],
        [nan, nan, nan,  ..., nan, nan, nan],
        ...,
        [nan, nan, nan,  ..., nan, nan, nan],
        [nan, nan, nan,  ..., nan, nan, nan],
        [nan, nan, nan,  ..., nan, nan, nan]], grad_fn=<MulBackward0>)
[W 2024-04-07 20:31:41,964] Trial 5 failed with value None.

I'm using the latest version with no Ray Tune support.
Versions / Dependencies
Neuralforecast 1.7.0
Python 3
Reproduction script
It'd be difficult to share because it does not happen always
Issue Severity
High: It blocks me from completing my task.

Hey @zzzrbx, thanks for using neuralforecast. This isn't a shape error, the check that is failing is that it expects the values to be non-negative and they're all NaNs. Are you using scalers?

Yes i’m using the robust scaler
On Mon, 8 Apr 2024 at 17:46, José Morales @.***> wrote:

Hey @zzzrbx https://github.com/zzzrbx, thanks for using neuralforecast.
This isn't a shape error, the check that is failing is that it expects the
values to be non-negative and they're all NaNs. Are you using scalers?
—
Reply to this email directly, view it on GitHub
https://github.com/Nixtla/neuralforecast/issues/957#issuecomment-2043217279,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFREVQ5YYBL57YFFSW25KMDY4LCYDAVCNFSM6AAAAABF3UEHNKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBTGIYTOMRXHE
.
You are receiving this because you were mentioned.Message ID:
@.***>

Is it on the model (batches) or in the NeuralForecast constructor? If you can at least provide the code you're running that'd help a lot.

I'm using the code below, basically taken from the documentation. The error comes up more often as I increase the number of trials in optuna (I'm using CPU with no ray tune)
def config_nhits(trial):
    return {
        'futr_exog_list': futr_exog_list,
        'hist_exog_list': hist_exog_list,
        'max_steps': trial.suggest_int("max_steps", 100, 300),
        'input_size': h,
        'activation':'ReLU',
        'scaler_type':'robust',
        'pooling_mode': 'AvgPool1d',
        'learning_rate': trial.suggest_loguniform("learning_rate", 1e-5, 1e-1),
        'n_pool_kernel_size': trial.suggest_categorical("n_pool_kernel_size", [[2, 2, 2], [16, 8, 1]]),
        'n_freq_downsample': trial.suggest_categorical("n_freq_downsample", [[168, 24, 1], [24, 12, 1], [1, 1, 1]]),
        'batch_size': trial.suggest_int("batch_size", 8, 16, 32),
        'inference_windows_batch_size': 1,
        'random_seed': trial.suggest_int("random_seed", 1, 10),
        'val_check_steps': 10,
    }

    models = [
        AutoNHITS(
            h=h,
#            loss=DistributionLoss(distribution='StudentT', level=[80, 90], return_params=True),
            config=config_nhits,
            search_alg=optuna.samplers.TPESampler(),
            backend='optuna',
            num_samples=50,
            cpus=20,
        )
    ]

I see you commented the DistributionLoss - what distribution are you using when you see the error? And, does the error also occur you change the distribution type?

I’m using Student-t most of the time but it happens with tweedie as well.
Haven’t tested other distributions yet
On Thu, 11 Apr 2024 at 11:27, Olivier Sprangers @.***>
wrote:

I see you commented the DistributionLoss - what distribution are you using
when you see the error? And, does the error also occur you change the
distribution type?
—
Reply to this email directly, view it on GitHub
https://github.com/Nixtla/neuralforecast/issues/957#issuecomment-2049387266,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFREVQ25NI3DGN2RS35XS7LY4ZQRHAVCNFSM6AAAAABF3UEHNKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBZGM4DOMRWGY
.
You are receiving this because you were mentioned.Message ID:
@.***>

Can you test with a Normal distribution? I want to exclude the possibility of this being an issue related to the distributions.
Also, the initial error you showed above is (I think) when running the Student-t. What is the exact error you get with the Tweedie?

Hey @zzzrbx just checking in - did you have any luck trying out with the Normal distribution?

I am facing the same problem when trying to use Tweedie distribution. Both when scaling on the model (batches) and using local_scaler. I have tried 'standard', 'robust', and 'boxcox' scaler types. Still ends up with the same problem.
The code I am running
autonhits = AutoNHITS(
    h=HORIZON,
    loss=DistributionLoss('Tweedie', level=[75], rho=1.5),
    num_samples=25,
    config=NHITS_objective_optuna,
    backend='optuna'
)

 nf = NeuralForecast(
      models=[autonhits],    # AutoNHITS
      freq='MS',
      local_scaler_type=LOCAL_SCALER_TYPE,
  )

  nf.cross_validation(df=ts_train_df, verbose=False, step_size=HORIZON, refit=True,
                      val_size=HORIZON)

Here is the error I get
File c:\...\torch\distributions\distribution.py:68, in Distribution.__init__(self, batch_shape, event_shape, validate_args)
     [66](file:///.../torch/distributions/distribution.py:66)         valid = constraint.check(value)
     [67](file:///.../torch/distributions/distribution.py:67)         if not valid.all():
---> [68](file:///.../torch/distributions/distribution.py:68)             raise ValueError(
     [69](file:///.../torch/distributions/distribution.py:69)                 f"Expected parameter {param} "
     [70](file:///.../torch/distributions/distribution.py:70)                 f"({type(value).__name__} of shape {tuple(value.shape)}) "
     [71](file:///.../torch/distributions/distribution.py:71)                 f"of distribution {repr(self)} "
     [72](file:///.../torch/distributions/distribution.py:72)                 f"to satisfy the constraint {repr(constraint)}, "
     [73](file:///.../torch/distributions/distribution.py:73)                 f"but found invalid values:\n{value}"
     [74](file:///.../torch/distributions/distribution.py:74)             )
     [75](file:///.../torch/distributions/distribution.py:75) super().__init__()

ValueError: Expected parameter concentration (Tensor of shape (1000, 128, 3)) of distribution Gamma(concentration: torch.Size([1000, 128, 3]), rate: torch.Size([1000, 128, 3])) to satisfy the constraint GreaterThan(lower_bound=0.0), but found invalid values:
tensor([[[0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.],
         ...,
         [0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.]],

        [[0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.],
         ...,
         [0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.]],

        [[0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.],
         ...,
         [0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.]],

        ...,

        [[0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.],
         ...,
         [0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.]],

        [[0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.],
         ...,
         [0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.]],

        [[0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.],
         ...,
         [0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.]]], device='cuda:0')

@fariduca I think some of our bounds are too tight for the distributions, this seems the same issue as you are experiencing. I am working on fixing this.

waiting for the solution. This kind of error is totally beyond my scope.:)

I am facing the same error when using either the Poisson or the Tweedie distribution. Also, I am not using scalers.


Accept number inputs

Is your feature request related to a problem? Please describe.
Currently, this pdftk library will throw an error upon inputting a JSON with number property (e.g. {"some_field": 1}).
Describe the solution you'd like
It would be good if the library will accept numbers, by converting it to string automatically. This should be achievable by using JS's Number.prototype.toString() or some other way.
Describe alternatives you've considered
At least, it should be documented clearly that pdftk doesn't take numbers

Good catch! Look for version 2.0.3 in npm later today


" Templates Creating VM from Template with RHEL Template when the VirtualMachine was created should succeed to start the VirtualMachine via oc command" fails

/kind bug
What happened:
CI fails
What you expected to happen:
CI passes
How to reproduce it (as minimally and precisely as possible):
http://jenkins.ovirt.org/job/kubevirt_kubevirt_standard-check-pr/2494/testReport/(root)/Tests
and https://jenkins.ovirt.org/job/kubevirt_kubevirt_standard-check-pr/test_results_analyzer/
Anything else we need to know?:
Environment:

KubeVirt version (use virtctl version):
Kubernetes version (use kubectl version):
VM or VMI specifications:
Cloud provider or hardware configuration:
OS (e.g. from /etc/os-release):
Kernel (e.g. uname -a):
Install tools:
Others:

@gszasz thoughts?

{ [{PodScheduled False 0001-01-01 00:00:00 +0000 UTC 2018-11-21 23:45:24 +0000 UTC Unschedulable 0/2 nodes are available: 1 Insufficient memory, 1 node(s) didn't find available persistent volumes to bind.}] Scheduling [] <nil>}}

It seems that the PV with an RHEL image is either not created, or does not have proper label. I've checked contents of the automation/test.sh where PV is being created, as well as the code in tests/utils.go that creates complementary PVC. Everything seems to be okay.

Thus what is the root cause for this problem?

ping?

@fabiand I need access to the CI environment to figure out why the PV is not available at the time of test execution. @gbenhaim could keep the environment running, and he can give me an access, but I do not see him online yet.

Are you able to reproduce this issue locally

This one already fixed.


Mapnik 3.2.0 Changelog

Compiling a list of changes associated with 3.2.0

@springmeyer What else needs to be in the changelog?

@flippmoke hmm, what do you see needing to be added? I notice https://github.com/mapnik/node-mapnik/pull/405 needs a mention and we need an brief entry on what changed in mapnik/mapnik-packaging.

@flippmoke hmm, what do you see needing to be added? I notice #405 needs a mention and we need an brief entry on what changed in mapnik/mapnik-packaging.

aren't the only changes in mapnik-packaging mapnik changes, not node-mapnik?

Remind me, what changed in mapnik packaging?

@flippmoke - just added the changes capturing a few deps that I upgraded: e37e1cd
@pnorman - because we package binaries and they include deps this is why mapnik-packaging (which controls dep versions) needs to be documented.


KAFKA-14563: RemoveClient-Side AddPartitionsToTxn Requests

https://issues.apache.org/jira/browse/KAFKA-14563

Also cc: @artemlivshits to take a look :)

Hmm have we checked the tests @CalvinConfluent? There seem to be some issues. (Not just the threads, but some related to transactions)

Close this PR for https://github.com/apache/kafka/pull/17698


GET /v1/type1?include=type2 returns type2 resources that are in state=purged

Include should not return purged resources.

Closing, we're just going to end up getting rid of include in API v2


add option to publish created items in the target space when syncing content between two spaces and stories were published in the source space

The feature would affect: (check one with "x")

[ ] app.storyblok.com (CMS - Interface)
[ ] api.storyblok.com (CMS - Content Delivery API)
[ ] mapi.storyblok.com (CMS - Management API)
[ ] capi.storyblok.com (Commerce - API)
[ ] Commerce - Interface
[x] CLI

Is your feature request related to a problem? Please describe.
At the moment it is needed to manually publish the stories in the target space when the content has been synchronized as the stage isn't being set to the same as in the original space.
Describe the solution you'd like
It would be helpful that the CLI publishes the stories which were originally published in the source space.

@Slackman2015 Hello my friend, sorry for the delay in responding.
The current version of CLI v3.17.0 had this behavior corrected, now, when using the sync command, the stories published in the source will be published in the target.


Support splat attributes

Splat converts a hash into attribute key/value pairs.
Slim:
.card*{'data-url'=>place_path(place), 'data-id'=>place.id} = place.name

HTML:

Slim's house

See slim docs: Splat Attributes.

Crucially, the hash can be returned indirectly:
.card *method_which_returns_hash = place.name
.card *@hash_instance_variable = place.name

I guess in Elixir, it could make sense to support expressions that evaluate to any type of dict, whether that's a keyword list or a map.
As for literal hash syntax, do you think it makes more sense to support the Ruby hash syntax (in your example above) for compatibility with Ruby-Slim, or to instead use some (or every) Elixir dict syntax? I'm thinking the latter.

Sorry those examples were copied and pasted directly from the Slim documentation, we should definitely use Elixir dict syntax.

:thumbsup:

🎉


INBOX-65 enforce coding style rules

New rules:

require newline after variable declaration
require newline before return
require newline after use strict
require curly braces for: "if", "else", "for", "while", "do", "try", "catch", "switch"
prevent trailing whitespaces
prevent unused variables
validate indentation (* 2 spaces)

:+1:

:+1:

Replaced by https://github.com/linagora/jmap-client/pull/16


TypeError: Cannot read property 'string' of undefined

I ran into this issue and I don't know how to fix it.
react-markdown-editor.js:6 Uncaught TypeError: Cannot read property 'string' of undefined
at Object. (react-markdown-editor.js:6)
at e (react-markdown-editor.js:1)
at Object. (react-markdown-editor.js:6)
at e (react-markdown-editor.js:1)
at Object. (react-markdown-editor.js:6)
at e (react-markdown-editor.js:1)
at react-markdown-editor.js:1
at react-markdown-editor.js:1
at ./node_modules/react-markdown-editor/dist/react-markdown-editor.js (react-markdown-editor.js:1)
at Object../node_modules/react-markdown-editor/dist/react-markdown-editor.js (react-markdown-editor.js:1)
at webpack_require (bootstrap 7a3575ba3c8fd4489540:678)
at fn (bootstrap 7a3575ba3c8fd4489540:88)
at Object../src/components/MyEditor.js (App.js:19)
at webpack_require (bootstrap 7a3575ba3c8fd4489540:678)
at fn (bootstrap 7a3575ba3c8fd4489540:88)
at Object../src/App.js (App.css?9a66:26)
at webpack_require (bootstrap 7a3575ba3c8fd4489540:678)
at fn (bootstrap 7a3575ba3c8fd4489540:88)
at Object../src/index.js (index.css?f255:26)
at webpack_require (bootstrap 7a3575ba3c8fd4489540:678)
at fn (bootstrap 7a3575ba3c8fd4489540:88)
at Object.0 (registerServiceWorker.js:117)
at webpack_require (bootstrap 7a3575ba3c8fd4489540:678)
at ./node_modules/ansi-regex/index.js.module.exports (bootstrap 7a3575ba3c8fd4489540:724)
at bootstrap 7a3575ba3c8fd4489540:724
This is the code I'm using...
import React, { Component } from 'react';
import { MarkdownEditor } from 'react-markdown-editor';

export default class MyEditor extends Component {
    render() {
        return (
            <MarkdownEditor initialContent='test' iconsSet='font-awesome' />
        );
    }
}

What version of React and react-markdown-editor are you running?
Could you paste your package.json in here?
Thanks!

Just installed the beta and works just fine. Thanks :D


fix example in readme

Coverage remained the same when pulling dfd32c4cf227dca4cb3cf1a671a5f08f5cb31d32 on bevanhunt:update-readme into<PHONE_NUMBER>66e1d8f165dd981f4bab1f862da1de on foss-haas:master.

Thanks for the heads up. I've rewritten the example section for 1.6. I hope it is a bit clearer now.

Thanks for the update to the readme and for the new version - they are great! I found one small issue - I will submit a new PR. FYI - I created a demo app from your new readme here: https://github.com/bevanhunt/react-fynx-login-demo

Sweet. I'll add a link in the readme.

Thanks!


Hoist some JS cos calls up one loop level

fx[0] and fy[0] are also always 1.0, so we could possibly tweak the code a little further, if you want to remove more cos calls.
And, of course, update Java, Rust and Swift. But I only ran the JS code.


Suggestions not showing dynamic list

Hi, is there a way to manually show the suggestions overlay?
I have this autocompletetextfield that gets it's suggestions from rest API. when I update the list of suggestions, the list is being updated but no suggestions are being shown.
I'm fairly new to Flutter and TYIA for the help

Hey, this is a feature I will add soon. Sit tight!

Just added the requested feature! Does what it says on the tin. Use addSuggestion, removeSuggestion or updateSuggestions to change suggestions dynamically.

You

Just added the requested feature! Does what it says on the tin. Use addSuggestion, removeSuggestion or updateSuggestions to change suggestions dynamically.

have you added this functionality?


Incorrect SDP Sent with OPUS

When I change the list of encodings so that only OPUS is selected, the following SDP is sent:
nonev=0
o=3162030020-jitsi.org 0 0 IN IP4 <IP_ADDRESS>
s=-
c=IN IP4 <IP_ADDRESS>
t=0 0
m=audio 5020 RTP/AVP 96
a=rtpmap:96 opus/48000/2
a=fmtp:96 usedtx=1
a=ptime:96 20
a=extmap:1 urn:ietf:params:rtp-hdrext:csrc-audio-level
a=extmap:2 urn:ietf:params:rt
The "a=ptime:96 20" is invalid, as jitsi appears to be prepending the RTP payload number before the ptime value.
This was seen when using version 2.9.5519. Please let me know if there are any diagnostics required.

Thank for the report. Can you test if this fixes it? https://github.com/jitsi/libjitsi/pull/167

In that case, I will wait for the correct fix to make it in. Out of interest, how do I test a patch? Do I just wait for the next nightly build?

You would have to re-build the project (or at least libjitsi in this case).

Ah. Are there instructions on how to do this somewhere (I have never compiled it before)?

To compile libjitsi  is really good way???


Add University of Liège in the organizer

As we will have several students from the University of Liege
participating, we have added it to the website.
Signed-off-by: Gaulthier Gain<EMAIL_ADDRESS>

🇧🇪 🇧🇪 🇧🇪


CDS input data not available

When downloading the assets using the CDS input, the following error message is received:

raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://cds.climate.copernicus.eu/resources/reanalysis-era5-single-levels

Is this service still available or am I missing some rights to access to the resources?

My error: the cds api was not properly configured. The url should have been url: https://cds.climate.copernicus.eu/api/v2

My error: the cds api was not properly configured. The url should have been url: https://cds.climate.copernicus.eu/api/v2


add ref prop to access svg html

Hey I would like to use a ref to get the HTML from the avatar svg, it would help with the avataaar-generator too because that seems to use ReactDOM to get the node to download. Thanks!

+1.
The only way to get the SVG (as avataaar-generator does) is with ReactDOM.findDOMNode() - which is deprecated.
The new React "concurrent mode" and "blocking mode" both don't work with findDOMNode(). It's likely it'll be dropped completely in React v17.
Happy to submit a PR for this.


Support non-conventional optimizers

Bug description
I turned off the automatic optimisation, because I am using SAM optimizer (https://github.com/davda54/sam). After that, the global_step of the trainer is not updating each train step, therefore checkpointcallback are not call even though it is pass to trainer ..
used callback :
pl.callbacks.ModelCheckpoint save_weights_only=True, save_top_k=3, monitor="val_acc", mode="max", save_on_train_epoch_end=False)
How to reproduce the bug
No response
Error messages and logs
# Error messages and logs here please

Environment

Current environment
#- Lightning Component (e.g. Trainer, LightningModule, LightningApp, LightningWork, LightningFlow):
- PyTorch Lightning Version 1.8.4:
- PyTorch Version 1.13:
- Python version 3.9:

More info
No response
cc @tchaton @justusschock @awaelchli @borda @carmocca

Thanks, for sure.
I used your example with the custom optimizer (see below) and the global step is not increasing ..

import os

import torch
from torch.utils.data import DataLoader, Dataset

from pytorch_lightning import LightningModule, Trainer
from classifiers.sam import SAM

class RandomDataset(Dataset):
    def __init__(self, size, length):
        self.len = length
        self.data = torch.randn(length, size)
        self.labels = torch.randint(low=0, high=2, size=(size,))

    def __getitem__(self, index):
        return self.data[index], self.labels[index]

    def __len__(self):
        return self.len

class BoringModel(LightningModule):
    def __init__(self):
        super().__init__()
        self.model = torch.nn.Linear(32, 2)
        self.automatic_optimization = False
        self.loss_fn = torch.nn.CrossEntropyLoss()

    def forward(self, x):
        return self.model(x)

    def training_step(self, batch, batch_idx):

        data, labels = batch

        opt = self.optimizers()

        # first forward-backward pass
        pred = self.model(data)
        loss_1 = self.loss_fn(pred, labels)
        self.manual_backward(loss_1)
        opt.first_step(zero_grad=True)

        # second forward-backward pass
        pred = self.model(data)
        loss_2 = self.loss_fn(pred, labels)
        self.manual_backward(loss_2)
        opt.second_step(zero_grad=True)

        print(self.trainer.global_step)
        return loss_2

    def configure_optimizers(self):
        base_optimizer = torch.optim.Adam
        optimizer = SAM(self.parameters(), base_optimizer, rho=1, adaptive=True, lr=0.001)
        scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=10, gamma=0.8)
        return {"optimizer": optimizer, "lr_scheduler": scheduler}

def run():
    train_data = DataLoader(RandomDataset(size=32, length=64), batch_size=2)

    model = BoringModel()
    trainer = Trainer(
        default_root_dir=os.getcwd(),
        max_epochs=2,
        limit_train_batches=3,
        enable_model_summary=False,
        enable_progress_bar=False,
        logger=False,
        enable_checkpointing=False,
    )
    trainer.fit(model, train_dataloaders=train_data)

if __name__ == "__main__":
    run()

Where the SAM optimizer is from https://github.com/davda54/sam.

class SAM(torch.optim.Optimizer):
    """
    SAM Optimizer
    https://github.com/davda54/sam
    """

    def __init__(self, params, base_optimizer, rho=0.05, adaptive=False, **kwargs):
        assert rho >= 0.0, f"Invalid rho, should be non-negative: {rho}"

        defaults = dict(rho=rho, adaptive=adaptive, **kwargs)
        super(SAM, self).__init__(params, defaults)

        self.base_optimizer = base_optimizer(self.param_groups, **kwargs)
        self.param_groups = self.base_optimizer.param_groups
        self.defaults.update(self.base_optimizer.defaults)

    @torch.no_grad()
    def first_step(self, zero_grad=False):
        grad_norm = self._grad_norm()
        for group in self.param_groups:
            scale = group["rho"] / (grad_norm + 1e-12)

            for p in group["params"]:
                if p.grad is None: continue
                self.state[p]["old_p"] = p.data.clone()
                e_w = (torch.pow(p, 2) if group["adaptive"] else 1.0) * p.grad * scale.to(p)
                p.add_(e_w)  # climb to the local maximum "w + e(w)"

        if zero_grad: self.zero_grad()

    @torch.no_grad()
    def second_step(self, zero_grad=False):
        for group in self.param_groups:
            for p in group["params"]:
                if p.grad is None: continue
                p.data = self.state[p]["old_p"]  # get back to "w" from "w + e(w)"

        self.base_optimizer.step()  # do the actual "sharpness-aware" update

        if zero_grad: self.zero_grad()

    @torch.no_grad()
    def step(self, closure=None):
        assert closure is not None, "Sharpness Aware Minimization requires closure, but it was not provided"
        closure = torch.enable_grad()(closure)  # the closure should do a full forward-backward pass

        self.first_step(zero_grad=True)
        closure()
        self.second_step()

    def _grad_norm(self):
        shared_device = self.param_groups[0]["params"][
            0].device  # put everything on the same device, in case of model parallelism
        norm = torch.norm(
            torch.stack([
                ((torch.abs(p) if group["adaptive"] else 1.0) * p.grad).norm(p=2).to(shared_device)
                for group in self.param_groups for p in group["params"]
                if p.grad is not None
            ]),
            p=2
        )
        return norm

    def load_state_dict(self, state_dict):
        super().load_state_dict(state_dict)
        self.base_optimizer.param_groups = self.param_groups

Okay. This happens because we assume there will be an optimizer.step() call, which is what we wrap to inject the strategy-specific logic (e.g. DDP)
The call chain is LightningModule.training_step() -> _LightningOptimizer.step() -> Strategy.optimizer_step() -> PrecisionPlugin.optimizer_step() -> Optimizer.step()
Your use of the SAM optimizer violates this assumption, as you are calling two different step methods ({first,second}_step) which are not wrapped like .step(). It's not clear to me if you would expect to increase the global_step count after each or if only after the second_step().
To resolve this, we would need some mechanism to indicate what method we should wrap.
cc @awaelchli @justusschock in case they have suggestions in this regard.
Another example of this issue is in https://github.com/ludwigwinkler/JaxLightning/blob/8585863be636152b6adba77a0436ff7509fb92f3/BNN/JaxLightning_BNN.py#L215-L217 (cc @ludwigwinkler) which also suffers from this issue because the Jax optimizer uses .update() instead of .step()

The SAM optimizer training step can be rewrite to classical form with a single closure-based step function
    def training_step(self, batch, batch_idx):

        data, labels = batch
        opt = self.optimizers()

        def closure():
            loss = self.loss_fn(self.model(data), labels)
            loss.backward()
            return loss

        loss = self.loss_fn(self.model(data), labels)
        loss.backward()
        opt.step(closure)
        opt.zero_grad()

        print(self.trainer.global_step)
        return loss

After that , pl is able to wrap call .step()  and self.trainer.global_step is increasing.

If I understand this here correctly, my proposal is to have a check in our LightningOptimizer wrapper that the step method is available. If not, raise an error suggesting the user should do optimizer.step = optimizer.real_step_method to have it supported in Lightning. IMO this is the easiest and doesn't require new APIs.

The suggestion

have a check in our LightningOptimizer wrapper that the step method is available

is not foolproof: the SAM optimizer shown above offers first_step, second_step, and step. If the user didn't know about this limitation and called first_step and second_step, they would face this issue but such check wouldn't trigger because the Optimizer also defines a step.
But I don't have a better suggestion that doesn't involve a complex solution such as wrapping all optimizer methods and checking if parameters changed


Support for multiple server URLs/endpoints in Java API

Implement a way to provide the TerrastoreClient with multiple server URLs +
fail-over/blacklisting when a server stops responding.

Original issue reported on code.google.com by<EMAIL_ADDRESS>on 21 Jun 2010 at 9:25

Original comment by<EMAIL_ADDRESS>on 21 Jun 2010 at 9:33

Added labels: Milestone-2.1

I'll get back with comments shortly.

Original comment by<EMAIL_ADDRESS>on 26 Aug 2010 at 12:17

Thanks Sven.

I just can't find any comments on OrderedHostManager ... am I missing something?

Original comment by<EMAIL_ADDRESS>on 26 Aug 2010 at 1:49

First implementation based on the "HostManager" abstraction, providing the host
to connect to depending on implementation strategies.
Currently provided "single server" and "ordered server list" implementations.

See commit:
http://code.google.com/p/terrastore/source/detail?r=f71d9d2c5c68ad88d1db84bd91b1
7564fb0b3d69&repo=javaclient

Sven, do you mind to review for feedback?

Original comment by<EMAIL_ADDRESS>on 26 Aug 2010 at 11:58

Changed state: Started
Added labels: Priority-High

Looks solid to me. Well done!

Just a couple of comments on details in OrderedHostManager,
see draft comment on that class.

Original comment by<EMAIL_ADDRESS>on 26 Aug 2010 at 12:54

Original comment by<EMAIL_ADDRESS>on 24 Jul 2010 at 10:44

Added labels: Project-Terrastore-JavaClient

Original comment by<EMAIL_ADDRESS>on 11 Sep 2010 at 8:36

Changed state: Fixed

Weird. I've never used that comment function before. I see it if I open you
changeset on the site, and open the file from there.

Copy-paste, starting at line 43:

"Why the iteration?
'boolean found = hosts.contains(suspected)' ought to be enough.

At first I didn't see the logic behind removing and then immediately
adding the suspsected server URL.

Fixed and pushed ;)

Original comment by<EMAIL_ADDRESS>on 26 Aug 2010 at 2:13


Certificates of Controller Manager and Scheduler should be rotated when --cert-dir arg is specified

Is your feature request related to a problem? Please describe.
When k3s is provisioned with Rancher, the cert-dir args of cm/scheduler is specified. The certificate are used for rancher-system-agent to do health check for cm/scheduler.
When rotating cert which k3s command, those certs are not rotated for now. And When those certs are expired, cm/scheduler probes will fail and not be able to recover by itself.
Describe the solution you'd like
k3s certificate rotate should also rotate cm/scheduler certs. Just deleting the certs when rotating them and cm/scheduler will generate a new one on boot time.
Describe alternatives you've considered
It can also be done in Rancher side but kubeadm do the certificate rotation in the same logic so k3s should also take care of it.
Additional context
N/A

These certificates are not manager by k3s and are not signed by the k3s cluster CA. Since they are only enabled when the components are instructed by Rancher to generate these certs, Rancher is responsible for rotating them.


See if website images could be improved.

Website images look blurry, as discussed in original thread.
Moved from googlei18n/noto-fonts#67

Most images are now svn, so it's up to the browser.  The emoji color sample is a .png file.  I think the image quality is less of an issue there.  So I'm closing this, if it becomes an issue again we can reopen.


webpack: not found error

I followed the instructions in the "Getting Started" section.  When I go to run foreman start -f Procfile.dev I get the error below.  Looks like webpack is not on my PATH.
20:21:30 client.1 | > webpack -w --config webpack.config.js
20:21:30 client.1 |
20:21:30 client.1 | sh: 1: webpack: not found

Did I miss something?  I see a webpack folder in client/node_modules and I can run the webpack command from the bin folder in there.
FYI - I am running this on a Vagrant instance with Ubuntu 14.

In my local env I got around this by installing webpack with the global switch.  But, now deploying to Heroku I have the same situation:
remote:        cd client && npm run build:production
remote:        ><EMAIL_ADDRESS>build:production /tmp/build_fc486bb5c0d3dac023935545ae780563/client
remote:        > NODE_ENV=production webpack --config webpack.config.js
remote:        sh: 1: webpack: not found

@homerlex Please follow the instructions carefully here: https://github.com/shakacode/react_on_rails/blob/master/docs/additional-reading/heroku-deployment.md
My guess is that you are not configuring your package.json correctly.
If you'd like more individualized assistance, see http://www.shakacode.com/work and our coaching plan. We'd love to help!

I've read that page.  You mentioned that you suspect a problem in the package.json.  That document doesn't talk about what the proper setting are for Heroku.  My package.json is the one from the Hellow World example.  What adjustments need to be made to it to make it work at Heroku?

@homerlex Did you manage to find what was causing this? I'm having the same issue.

@vassyz - I have it working.  I don't recall what was the exact issue was but this is what my script looks like for production deployment now:
"build:production": "NODE_ENV=production webpack --config webpack.config.js",
Also make sure you add the nodejs buildpack:
heroku buildpacks:add --index 1 heroku/nodejs -a app_name
Let me know if this helps.

I managed to get it working by adding the postinstall script to the base package.json:
  "scripts": {
    "postinstall": "cd client && npm install"
  }

I'm not sure if I did something wrong, or if this should be mentioned in the Heroku deployment instructions.

@vassyz @homerlex Please let me know if this addresses part of the issue: https://github.com/shakacode/react_on_rails/commit/53af84126bb1a7c10a89849625938e84775f344e#diff-a8b868106a63acb6b1013d1969428d9a
Anything else we should add to that file?
https://github.com/shakacode/react_on_rails/blob/master/docs/additional-reading/heroku-deployment.md

Looks good to me. The postinstall script is the only thing not mentioned in the instruction that I had to add to get deployment working. 👍

For me the problem was that I had added NODE_ENV=production to the env vars of my build project. Removing it again solved it.


Getting 503 after installing in GKE with Private Ingress

After installing onto a GKE private cluster with a private ingress, I get the following error when I browse the site:
upstream connect error or disconnect/reset before headers. reset reason: connection termination

The logs for the proxy container show:
2020-08-04 02:09:34,404 [ERROR] [vert.x-eventloop-thread-0] [io.vertx.core.net.impl.ConnectionBase] java.io.IOException: Connection reset by peer

Here is my spec:
releaseName: nexus
  chart:
    repository: https://oteemo.github.io/charts
    name: sonatype-nexus
    version: 2.5.0
  values:
    nexusProxy:
      env:
        nexusHttpHost: repo.auth.logic
        nexusDockerHost: docker.auth.logic

    nexusBackup:
      env:
        targetBucket: "gs://authlogic-nexus-backup"
      persistence:
        storageClass: standard

    nexus:
      service:
        type: ClusterIP
      annotations:
        cloud.google.com/neg: '{ "ingress": true }'

    ingress:
      enabled: true
      annotations:
        nginx.ingress.kubernetes.io/ssl-redirect: "false"
        nginx.ingress.kubernetes.io/proxy-body-size: "0"
        kubernetes.io/ingress.class: "gce-internal"
        kubernetes.io/ingress.allow-http: "false"
      tls:
        secretName: auth-logic-tls
      path: /*

    persistence:
      storageClass: standard
      storageSize: 200Gi

    resources:
      requests:
        cpu: 250m
        memory: 4800Mi

I am able to browse the repository from these internal endpoints:
http://<IP_ADDRESS>:8080  -> Get the proxy page
http://<IP_ADDRESS>:8081 -> Get nexus

This appears to be an issue with the GKE load balancers.  Google support is helping.

This looks to be an issue with the gce-internal ingress which uses network endpoint groups (NEGs) against the nexus-proxy. When I direct the ingress to the nexus service directly, it works.  However, with this approach I cannot use the docker repo as the native docker repo (not proxied), returns a 401 or 400, so the health check always fails.

Same issue here.
@btomasini I wonder if you managed to solve the problem on your side.

By the way, why do you have nginx annotations on your ingress configuration ?


'React/RCTAnimationType.h' file not found

Hi ! I'm trying to build this lib in iOS but I have this error on the file 'RCTConvert.h': 'React/RCTAnimationType.h' file not found:
#import <React/RCTAnimationType.h> // 'React/RCTAnimationType.h' file not found
#import <React/RCTBorderStyle.h>
#import <React/RCTDefines.h>
#import <React/RCTLog.h>
#import <React/RCTPointerEvents.h>
#import <React/RCTTextDecorationLineType.h>
#import <yoga/Yoga.h>

The origin is this line in 'RCTOneSignal.m':
#if __has_include(<React/RCTConvert.h>)
#import <React/RCTConvert.h>
#import <React/RCTBridge.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTUtils.h>
#else
#import "RCTConvert.h" // This line is the origin of the error
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
#import "RCTUtils.h"
#endif

It seems to be related to this issue, expo can be the cause of the problem ?
Thanks for your help !
I'm using ExpoKit SDK 20 with react-native v47 (I already test it with v46)

Same issue here after trying to install using react-native link after ejecting from create-react-native-app. The solution for me was to install this using pods.

@kirkness Do you use ExpoKit ?

Yes - I ejected from create-react-native-app to an ExpoKit project

I already tried this but I've got the same issue....

One thing to remember is that if you have previously react-native linked it, you'll need to unlink (remove from Libraries and the Link Libraries Build Phase).

Oh my gosh it works, you rock 🎸 It has to appear in the docs that you can install it with Cacaopod !

omg it works for me too!!

@martinezguillaume @beeant  so this works for you for android and ios ?
Do i have to detach from expo ?

If you want to use this lib, you have to detach yes. But if you want a push notification service and don't care about one signal, expo already implemented one https://docs.expo.io/versions/latest/guides/push-notifications.html

@flieks Yes, I think so I'm detached from expo.

The pods approach worked for me. Just install the library via pods and follow the appDelegate steps in the docs
This stack overflow will help with unlinking
make sure you clean cmd + shift + k restart Xcode and then build cmd + b

@martinezguillaume does it work for you with latest Expo?

@slorber I don't use ExpoKit anymore, I can't help you 😭

@martinezguillaume @kirkness Hey guys, I am developing an app using ExpoKit and after getting the above error, I tried your solution. I unlinked react-native-onesignal and installed it manually via cocoapods, then followed the onesignal docs (https://github.com/geektimecoil/react-native-onesignal/). I now obtain this error:
llplatform/node_modules/react-native-onesignal/ios/RCTOneSignal/RCTOneSignalEventEmitter.m:9:9: fatal error: 'OneSignal.h' file not found #import "OneSignal.h"         ^~~~~~~~~~~~~ 1 error generated.
OneSignal.h file not found
Any ideas what might fix it and make it work with expokit? Thanks!

Hey @BorregoIgnacio2, are you sure u unlinked it totally ? Like, remove react-native-onesignal lib from Libraries folder (in xCode), and remove it from Header Search Path

I had to manually link RCTOneSignal.xcodeproj even though I used pods, in order to add libRCTOneSignal to the OneSignalNotificationServiceExtension. Now I'm having this problem and unsure whether to unlink it again to resolve?

@dancherb I have the same issue, bro! Have you find a way to solve it?)

Same issue here :/


Add exception handling for requests module

Fixes #4

Thanks, I forgot requests is not in the standard lib.


Mocking retries?

I'm trying to mock a service that is supposed to be called multiple times and fail, and then succeed at the Nth time. Since these are retries the requests should be the same, so there's no way to distinguish them by parameters or by path/body.
Is that something that can be done with httpmock?

Hi. Thanks for reaching out.
Do you think delete will help you?

Do you think delete will help you here?

#[test]
fn delete_mock_test() {
    let server = MockServer::start();

    let mut m1 = server.mock(|when, then| {
        when.method(GET).path("/test");
        then.status(500);
    });

    let mut m2 = server.mock(|when, then| {
        when.method(GET).path("/test");
        then.status(200);
    });

    let response = get(&format!(
        "http://{}:{}/test",
        server.host(),
        server.port()
    ))
    .unwrap();

    assert_eq!(response.status(), 500);

    // As long as both m1 and m2 exist, m1 will take precedence over m2.
    // Let's delete m1 so we can respond with a successful response
    m1.delete();

    let response = get(&format!("http://{}/test", server.address())).unwrap();

    assert_eq!(response.status(), 200);
}

Interesting idea ... OK, let's keep this issue open and I'll try to get a PR for it after the next release (it's a big change, so it makes sense to wait a bit).

Until #108 lands here is a (ugly) work around to mock failing the first request:
static mut REQ_COUNT: u32 = 0;
...
let server = MockServer::start();
let get_mock = server.mock(|when, then| {
    when.method(GET).path("/test").matches(|_req: &HttpMockRequest| {
        let req = unsafe {
            let req = REQ_COUNT;
            REQ_COUNT += 1;
            req
        };
        req >= 1
    });
    then.status(200).body("TEST");
});

Its not pretty but is a reasonable workaround.


Inkscape Figure Manager errors when trying to create pdf-tex files

I am trying to get the latex file manager part to work but creating a file will generate the .svg but with error out on the creation of the .pdf and .pdf_tex file types. The following is the error displayed:

If anyone has a solution please let me know :)

Does this repeatedly happen if you do that again? Due to some unknown reasons, the inkscape file manager will fail to create all three files at once in the first cold-run. So maybe just cmd+z and try to trigger that shortcut again?

It does repeatedly happen if I try and retrigger the shortcut, the number of dateline != NULL errors increases every successive time I try

That error should not be fatal in any sense, I think. Have you tried to update all your packages?

Everything is up to date, so I don't know where the error is coming in. Can I configure the shortcuts to use the .svg instead of the .pdf_tex file?

 And if this doesn't work, then maybe try to run this via the terminal first to see whether everything is correctly installed.
p.s. do not forget to first runt watch command.

I just rebooted and this is the clean project, I also am getting the same error on the terminal when I try to run it. I made sure to use the watch command first. I am stumped on this one

Wait, have you tried to modify the files and save them? I mean, those three files will only be created whenever the file manager export it to $\LaTeX$, so if you only create the file and do nothing (e.g., hasn't modified it and save it), then it will not export anything and hence will only leave you with that .svg.

Update it doesn't work the first time I try on the command line, but also doesn't error, its not until the second time that I try and create a figure that errors occur

Update it doesn't work the first time I try on the command line, but also doesn't error, its not until the second time that I try and create a figure that errors occur

This error shouldn't effect anything since I get it all the time (well, I should try to fix it, but I haven't been able to do that). Please try to modify the file and safe it, as I said, and see whether that works.

I just tried to modify and save the files and it is unfortunately still not populating properly in the figures folder, or elsewhere that I can see

Can you provide a short video demonstrating the whole process or at least some screenshots? It's extremely difficult to debug in this way. In particular, show that it correctly watch the file, it can create the template .svg, the terminal output, the directory structure, and the saving process after modifying.

Here is my process, I have Inkscape figures installed in a venv, which I make sure to activate first and then go through the process of watching, creating, and then modifying and saving before trying to recompile the LaTeX file. I am using your note template as the default for the document and start on a fresh lecture page with not other Lecter files being compiled
https://user-images.githubusercontent.com/75457827/212785745-b2b4eff2-a6e9-403e-ae5f-5682c272fa33.mov

I think there are some problems with watch.  And I just noticed, it appears to be that when you set-up the watch correctly, when you create the file, it'll automatically export for you, so you really should see all three files at once:
https://user-images.githubusercontent.com/60427058/212786806-c73cfda9-7bf6-4f2c-bcff-735cedad309f.mov
Hope this help

I have modified the files in the Inkscapefigures folder, I just tried recopying all of the files from your repo into the Inkscape-figures file and still no luck. Additionally I just went over the tutorial for configuring the Inkscape figure manager and didn't see anything I missed after making sure to read it slowly. Is there anyway I can look at any logs created from the watch command?

A quick test is to watch twice: if it's triggered correctly, then you should see something like this:

Other than that, I don't think there's a way to see that.

I get this error, but I have to watch multiple times before the error occurs. I tried to see if the number of times was constant but it varies from 4-6 times I can watch before the unable to lock onto the pidfile error occurs

Hmm, then that's weird. Then after you get that error, can you create files and export correctly?

No the same issue happens where the .svg file is generated but no other files :(

In case the OS/hardware is making a difference I am running Ventura 13.1 on an M1 Macbook pro

In case the OS/hardware is making a difference I am running Ventura 13.1 on an M1 Macbook pro

That's what I'm using currently, so that shouldn't be a problem. I guess it might be something tricker: such as the python environment or something like that. Does your modification of inkscapefigures is exactly the one used by your terminal? Triggering a shortcut in VS Code sends the command into the default VS Code terminal, and that might not be the same as what you had used to test (though both of them seem to fail...) To be honest I have no idea why this is the case since my Inkscape is also up to date.

I only have Inkscapefigures installed in one place on this computer, which is in that virtual environment so I will try to restart computer again and see if anything else works but I need to step away from debugging for a bit. Thank you for your help and I will let you know if I make any progress. Out of curisosity for the vscode settings are those in your global settings or in a workspace setting?

Everything is global, but what is in this repo is just a part of my settings specific for Inkscape figures.

I got some new errors today so perhaps these hold a clue:
(LaTeXenv) coltwhitley@Colts-MacBook-Pro Winter2023 % inkscape-figures create test3 /Users/coltwhitley/Documents/CalPoly/Winter2023/ComplexAnalysisII/LectureNotes/Fig
ures/
(LaTeXenv) coltwhitley@Colts-MacBook-Pro Winter2023 %
(org.inkscape.Inkscape:4847): GLib-CRITICAL **: 09:09:21.488: g_date_time_format: assertion 'datetime != NULL' failed

(org.inkscape.Inkscape:4847): GLib-CRITICAL **: 09:09:21.489: g_date_time_format: assertion 'datetime != NULL' failed

(org.inkscape.Inkscape:4847): GLib-CRITICAL **: 09:09:21.489: g_date_time_format: assertion 'datetime != NULL' failed

(org.inkscape.Inkscape:4847): GLib-CRITICAL **: 09:09:21.490: g_date_time_format: assertion 'datetime != NULL' failed
Shortcut::add_shortcut: duplicate shortcut found for: <Primary>comma  Old: app.preferences  New: app.transform-scale(0.5) !
1   HIToolbox                           0x00000001aa3c85c8 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 120
2   HIToolbox                           0x00000001aa3c8188 _ZN15MenuBarInstance14EnableAutoShowEv + 60
3   HIToolbox                           0x00000001aa3358bc _ZN15MenuBarInstance21UpdateAggregateUIModeE21MenuBarAnimationStylehhh + 1184
4   HIToolbox                           0x00000001aa3c8004 _ZN15MenuBarInstance19SetFullScreenUIModeEjj + 180
5   AppKit                              0x00000001a41be008 -[NSApplication _setPresentationOptions:instance:flags:] + 956
6   AppKit                              0x00000001a4053bb0 -[NSApplication _updateFullScreenPresentationOptionsForInstance:] + 404
7   CoreFoundation                      0x00000001a0c75570 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
8   CoreFoundation                      0x00000001a0d13054 ___CFXRegistrationPost_block_invoke + 88
9   CoreFoundation                      0x00000001a0d12f9c _CFXRegistrationPost + 440
10  CoreFoundation                      0x00000001a0c46b74 _CFXNotificationPost + 708
11  Foundation                          0x00000001a1b3472c -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
12  AppKit                              0x00000001a41be58c spacesNotificationHandler + 96
13  SkyLight                            0x00000001a58a84dc _ZN12_GLOBAL__N_123notify_datagram_handlerEj15CGSDatagramTypePvmS1_ + 896
14  SkyLight                            0x00000001a5bd44c4 _ZN21CGSDatagramReadStream26dispatchMainQueueDatagramsEv + 228
15  SkyLight                            0x00000001a5bd43c0 ___ZN21CGSDatagramReadStream15mainQueueWakeupEv_block_invoke + 28
16  libdispatch.dylib                   0x00000001a0a189dc _dispatch_call_block_and_release + 32
17  libdispatch.dylib                   0x00000001a0a1a504 _dispatch_client_callout + 20
18  libdispatch.dylib                   0x00000001a0a28d1c _dispatch_main_queue_drain + 928
19  libdispatch.dylib                   0x00000001a0a2896c _dispatch_main_queue_callback_4CF + 44
20  CoreFoundation                      0x00000001a0cc1d50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
21  CoreFoundation                      0x00000001a0c7f7d0 __CFRunLoopRun + 2036
22  CoreFoundation                      0x00000001a0c7e888 CFRunLoopRunSpecific + 612
23  HIToolbox                           0x00000001aa353fa0 RunCurrentEventLoopInMode + 292
24  HIToolbox                           0x00000001aa353de4 ReceiveNextEventCommon + 672
25  HIToolbox                           0x00000001aa353b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
26  AppKit                              0x00000001a3f00424 _DPSNextEvent + 632
27  AppKit                              0x00000001a3eff5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
28  libgdk-3.0.dylib                    0x0000000106030314 poll_func + 220
29  libglib-2.0.0.dylib                 0x0000000103fbcb50 g_main_context_iterate + 424
30  libglib-2.0.0.dylib                 0x0000000103fbcc74 g_main_context_iteration + 116
31  libgio-2.0.0.dylib                  0x0000000103db07d4 g_application_run + 528
32  inkscape                            0x0000000102fca6c8 main + 7272
33  dyld                                0x00000001a0877e50 start + 2544
1   HIToolbox                           0x00000001aa35390c _ZN15MenuBarInstance22RemoveAutoShowObserverEv + 44
2   HIToolbox                           0x00000001aa3c8fbc _ZN15MenuBarInstance15DisableAutoShowEv + 36
3   HIToolbox                           0x00000001aa3c90b0 _ZN15MenuBarInstanceD2Ev + 128
4   HIToolbox                           0x00000001aa3c8ee0 _ZN15MenuBarInstance7ReleaseEv + 56
5   AppKit                              0x00000001a455b5ec -[NSHIPresentationInstance discard] + 228
6   AppKit                              0x00000001a491ab58 -[_NSFullScreenSpace(PresentationInstance) discardPresentationInstance] + 32
7   AppKit                              0x00000001a491abb0 -[_NSFullScreenSpace(PresentationInstance) activateFullScreenPresentationOptions] + 64
8   AppKit                              0x00000001a4774c20 -[_NSExitFullScreenTransitionController _doSucceededToExitFullScreen] + 40
9   AppKit                              0x00000001a47756f8 __63-[_NSExitFullScreenTransitionController _performExitFullScreen]_block_invoke + 236
10  libxpc.dylib                        0x00000001a091222c _xpc_connection_reply_callout + 124
11  libxpc.dylib                        0x00000001a091211c _xpc_connection_call_reply_async + 88
12  libdispatch.dylib                   0x00000001a0a1a584 _dispatch_client_callout3 + 20
13  libdispatch.dylib                   0x00000001a0a38710 _dispatch_mach_msg_async_reply_invoke + 344
14  libdispatch.dylib                   0x00000001a0a28c70 _dispatch_main_queue_drain + 756
15  libdispatch.dylib                   0x00000001a0a2896c _dispatch_main_queue_callback_4CF + 44
16  CoreFoundation                      0x00000001a0cc1d50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
17  CoreFoundation                      0x00000001a0c7f7d0 __CFRunLoopRun + 2036
18  CoreFoundation                      0x00000001a0c7e888 CFRunLoopRunSpecific + 612
19  HIToolbox                           0x00000001aa353fa0 RunCurrentEventLoopInMode + 292
20  HIToolbox                           0x00000001aa353c30 ReceiveNextEventCommon + 236
21  HIToolbox                           0x00000001aa353b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
22  AppKit                              0x00000001a3f00424 _DPSNextEvent + 632
23  AppKit                              0x00000001a3eff5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
24  libgdk-3.0.dylib                    0x0000000106030314 poll_func + 220
25  libglib-2.0.0.dylib                 0x0000000103fbcb50 g_main_context_iterate + 424
26  libglib-2.0.0.dylib                 0x0000000103fbcc74 g_main_context_iteration + 116
27  libgio-2.0.0.dylib                  0x0000000103db07d4 g_application_run + 528
28  inkscape                            0x0000000102fca6c8 main + 7272
29  dyld                                0x00000001a0877e50 start + 2544

Just to be save, what are the versions of python and Inkscape you're using?

I am running Inkscape 1.2.2 and python 3.9.6

That's weird; I'm using the same version for Inkscape, and I don't think the python version makes any difference.

I'm using python 3.8.8 via conda.

I come across this issue, which suggests installing fswatch via brew install fswatch for solving weird watch problems. Maybe try this?


SplashScreen image can be found exception occurs while try to package the app using single-project MSIX

Describe the bug

While we try to convert the Blank App, packaged with Windows Application Packaging Project to single Blank App, packaged by using the given guidelines in https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/single-project-msix?tabs=csharp page, it builds the application properly, but cannot be able to launch the application by throws the error.
Note:
If we remove the SplashScreen images assigning tag from Package.appxmanifest file, then the application runs properly.

Steps to reproduce the bug

Open the App8.zip sample
Build the solution (it's succeed)
Try to run the solution
Note: It throws the DEP0700: Registration of the app failed. [0x80073CF6] AppxManifest.xml(28,27): error 0x80070003: Cannot install or update package cb0bed1f-136b-48ef-bff6-ecc888319622_0hx8bvsc3x46r because the splash screen image [SplashScreen.png] cannot be located. Verify that the package contains an image that can be used as a splash screen for the application, and that the package manifest points to the correct location in the package where this splash screen image can be found exception.

Expected behavior
Application should run without any excpetion,
Screenshots

NuGet package version
WinUI 3 - Windows App SDK 1.0 (If you're seeing your issue in older previews of WinUI 3, please try this release)
Windows app type

[ ] UWP
[X] Win32

Device form factor
Desktop
Windows version
October 2020 Update (19042)
Additional context
No response

@evelynwu-msft FYI


onnx exports

Would it be possible to share the onnx exports?

im looking to try CPU

Download the models and set the path. Next, run the following python script to get the inference results.
import sys
import gc
import re
import time
import math
import torch
import torchaudio
import jieba
from pypinyin import lazy_pinyin, Style
import numpy as np
import onnxruntime

F5_project_path      = "/Users/dake/Downloads/F5-TTS-main"                   # The F5-TTS Github project download path.
onnx_model_A         = "/Users/dake/Downloads/F5_ONNX/F5_Preprocess.onnx"    # The exported onnx model path.
onnx_model_B         = "/Users/dake/Downloads/F5_ONNX/F5_Transformer.onnx"   # The exported onnx model path.
onnx_model_C         = "/Users/dake/Downloads/F5_ONNX/F5_Decode.onnx"        # The exported onnx model path.

reference_audio      = "/Users/dake/Downloads/F5-TTS-main/tests/ref_audio/test_en_1_ref_short.wav"  # The reference audio path.
generated_audio      = "/Users/dake/Downloads/F5-TTS-main/tests/generated.wav"          # The generated audio path.
ref_text             = "Some call me nature, others call me mother nature."             # The ASR result of reference audio.
gen_text             = "Hello, How are you? I am a super hero on Earth."                # The target TTS.

ORT_Accelerate_Providers = []           # If you have accelerate devices for : ['CUDAExecutionProvider', 'TensorrtExecutionProvider', 'CoreMLExecutionProvider', 'DmlExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'MIGraphXExecutionProvider', 'AzureExecutionProvider']
                                        # else keep empty.

RANDOM_SEED = 9527

with open(f"{F5_project_path}/data/Emilia_ZH_EN_pinyin/vocab.txt", "r", encoding="utf-8") as f:
    vocab_char_map = {}
    for i, char in enumerate(f):
        vocab_char_map[char[:-1]] = i
vocab_size = len(vocab_char_map)

def is_chinese_char(c):
    cp = ord(c)
    return (
        0x4E00 <= cp <= 0x9FFF or  # CJK Unified Ideographs
        0x3400 <= cp <= 0x4DBF or  # CJK Unified Ideographs Extension A
        0x20000 <= cp <= 0x2A6DF or  # CJK Unified Ideographs Extension B
        0x2A700 <= cp <= 0x2B73F or  # CJK Unified Ideographs Extension C
        0x2B740 <= cp <= 0x2B81F or  # CJK Unified Ideographs Extension D
        0x2B820 <= cp <= 0x2CEAF or  # CJK Unified Ideographs Extension E
        0xF900 <= cp <= 0xFAFF or    # CJK Compatibility Ideographs
        0x2F800 <= cp <= 0x2FA1F     # CJK Compatibility Ideographs Supplement
    )

def convert_char_to_pinyin(text_list, polyphone=True):
    final_text_list = []
    merged_trans = str.maketrans({
        '“': '"', '”': '"', '‘': "'", '’': "'",
        ';': ','
    })
    chinese_punctuations = set("。，、；：？！《》【】—…")
    for text in text_list:
        char_list = []
        text = text.translate(merged_trans)
        for seg in jieba.cut(text):
            if seg.isascii():
                if char_list and len(seg) > 1 and char_list[-1] not in " :'\"":
                    char_list.append(" ")
                char_list.extend(seg)
            elif polyphone and all(is_chinese_char(c) for c in seg):
                pinyin_list = lazy_pinyin(seg, style=Style.TONE3, tone_sandhi=True)
                for c in pinyin_list:
                    if c not in chinese_punctuations:
                        char_list.append(" ")
                    char_list.append(c)
            else:
                for c in seg:
                    if c.isascii():
                        char_list.append(c)
                    elif c in chinese_punctuations:
                        char_list.append(c)
                    else:
                        char_list.append(" ")
                        pinyin = lazy_pinyin(c, style=Style.TONE3, tone_sandhi=True)
                        char_list.extend(pinyin)
        final_text_list.append(char_list)
    return final_text_list

def list_str_to_idx(
    text: list[str] | list[list[str]],
    vocab_char_map: dict[str, int],  # {char: idx}
    padding_value=-1
):
    get_idx = vocab_char_map.get
    list_idx_tensors = [torch.tensor([get_idx(c, 0) for c in t], dtype=torch.int32) for t in text]
    text = torch.nn.utils.rnn.pad_sequence(list_idx_tensors, padding_value=padding_value, batch_first=True)
    return text

# ONNX Runtime settings
onnxruntime.set_seed(RANDOM_SEED)
session_opts = onnxruntime.SessionOptions()
session_opts.log_severity_level = 3  # error level, it a adjustable value.
session_opts.inter_op_num_threads = 0  # Run different nodes with num_threads. Set 0 for auto.
session_opts.intra_op_num_threads = 0  # Under the node, execute the operators with num_threads. Set 0 for auto.
session_opts.enable_cpu_mem_arena = True  # True for execute speed; False for less memory usage.
session_opts.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL
session_opts.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL

ort_session_A = onnxruntime.InferenceSession(onnx_model_A, sess_options=session_opts, providers=['CPUExecutionProvider'])
in_name_A = ort_session_A.get_inputs()
out_name_A = ort_session_A.get_outputs()
in_name_A0 = in_name_A[0].name
in_name_A1 = in_name_A[1].name
in_name_A2 = in_name_A[2].name
out_name_A0 = out_name_A[0].name
out_name_A1 = out_name_A[1].name
out_name_A2 = out_name_A[2].name
out_name_A3 = out_name_A[3].name
out_name_A4 = out_name_A[4].name
out_name_A5 = out_name_A[5].name
out_name_A6 = out_name_A[6].name

ort_session_B = onnxruntime.InferenceSession(onnx_model_B, sess_options=session_opts, providers=ORT_Accelerate_Providers.append('CPUExecutionProvider'))
in_name_B = ort_session_B.get_inputs()
out_name_B = ort_session_B.get_outputs()
in_name_B0 = in_name_B[0].name
in_name_B1 = in_name_B[1].name
in_name_B2 = in_name_B[2].name
in_name_B3 = in_name_B[3].name
in_name_B4 = in_name_B[4].name
in_name_B5 = in_name_B[5].name
in_name_B6 = in_name_B[6].name
out_name_B0 = out_name_B[0].name

ort_session_C = onnxruntime.InferenceSession(onnx_model_C, sess_options=session_opts, providers=['CPUExecutionProvider'])
in_name_C = ort_session_C.get_inputs()
out_name_C = ort_session_C.get_outputs()
in_name_C0 = in_name_C[0].name
in_name_C1 = in_name_C[1].name
out_name_C0 = out_name_C[0].name

# Run F5-TTS by ONNX Runtime
audio, sr = torchaudio.load(reference_audio)
if sr != SAMPLE_RATE:
    resampler = torchaudio.transforms.Resample(orig_freq=sr, new_freq=SAMPLE_RATE)
    audio = resampler(audio)
audio = audio.unsqueeze(0).numpy()
zh_pause_punc = r"。，、；：？！"
ref_text_len = len(ref_text.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, ref_text))
gen_text_len = len(gen_text.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, gen_text))
ref_audio_len = audio.shape[-1] // HOP_LENGTH + 1
max_duration = np.array(ref_audio_len + int(ref_audio_len / ref_text_len * gen_text_len / SPEED), dtype=np.int64)
gen_text = convert_char_to_pinyin([ref_text + gen_text])
text_ids = list_str_to_idx(gen_text, vocab_char_map).numpy()
time_step = np.array(0, dtype=np.int32)

print("\n\nRun F5-TTS by ONNX Runtime.")
start_count = time.time()
noise, rope_cos, rope_sin, cat_mel_text, cat_mel_text_drop, qk_rotated_empty, ref_signal_len = ort_session_A.run(
        [out_name_A0, out_name_A1, out_name_A2, out_name_A3, out_name_A4, out_name_A5, out_name_A6],
        {
            in_name_A0: audio,
            in_name_A1: text_ids,
            in_name_A2: max_duration
        })
while time_step < NFE_STEP:
    print(f"NFE_STEP: {time_step}")
    noise = ort_session_B.run(
        [out_name_B0],
        {
            in_name_B0: noise,
            in_name_B1: rope_cos,
            in_name_B2: rope_sin,
            in_name_B3: cat_mel_text,
            in_name_B4: cat_mel_text_drop,
            in_name_B5: qk_rotated_empty,
            in_name_B6: time_step
        })[0]
    time_step += 1
generated_signal = ort_session_C.run(
        [out_name_C0],
        {
            in_name_C0: noise,
            in_name_C1: ref_signal_len
        })[0]
end_count = time.time()

# Save to audio
audio_tensor = torch.tensor(generated_signal).squeeze(0)
torchaudio.save(generated_audio, audio_tensor, SAMPLE_RATE)

print(f"\nAudio generation is complete.\n\nONNXRuntime Time Cost in Seconds:\n{end_count - start_count:.3f}")

Can you make the models public?

Try again~

The Inference script was edited. Make sure to copy the latest one. : )

getting an error with the script:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "onnxruntime/capi/onnxruntime_inference_collection.py", line 220, in run
    return self._sess.run(output_names, input_feed, run_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: audio for the following indices
 index: 1 Got: 2 Expected: 1
 Please fix either the inputs/outputs or the model.

errr nevermind, the audio file is not formatted correctly ... sorry

i added this to handle >1 channel in wav
audio, sr = torchaudio.load(reference_audio)
if sr != SAMPLE_RATE:
    resampler = torchaudio.transforms.Resample(orig_freq=sr, new_freq=SAMPLE_RATE)  # noqa
    audio = resampler(audio)
if audio.shape[0] > 1:
    audio = torch.mean(audio, dim=0, keepdim=True)

im just getting noise in generated.wav

do we need to use vocos to generate the final wav?

All process including STFT and ISTFT was converted in ONNX operators. Directly run the three models should work.
The valid shape for audio is (1, 1, audio_len). Hence, it has to set the dim=-1 on torch.mean process.
if audio.shape[0] > 1:
    audio = torch.mean(audio, dim=-1, keepdim=True)

thanks, ill check ONNXRuntime version

Could you post the GPU one as well?

@rachelbeeson
Hello,~The person in charge of F5-TTS-ONNX is currently traveling on business. If you are willing to wait, we will provide you with a download link for F5-TTS-ONNX-Float16 on November 14 (+8 time zone). If you cannot wait, you might also consider exporting the model yourself in Float32 format and then quantizing it to Float16 for GPU device.

@rachelbeeson Hello~ The person in charge of F5-TTS-ONNX is currently traveling on business. If you are willing to wait, we will provide you with a download link for F5-TTS-ONNX-Float16 on November 14 (+8 time zone). If you cannot wait, you might also consider exporting the model yourself in Float32 format and then quantizing it to Float16 for GPU device.

No problem, thank you for the hint. I did try as you say (export and then change precision) but I found running the exported model on ONNX was slower than running the original on torch for GPU, so I guess I wanted to see if the owner's export would give me a similar result or if maybe I messed up somewhere :)

I am also keen to try the ONNX for gpu!

@rachelbeeson
@OrphBean
Hi~ Please click the link to get the F5-TTS-ONNX-Float16 models. Then, follow the inference script to test the F5-TTS.

When i run this with the provided script on my 4090 it takes about 48 seconds to create a 7 second output - and the output is of a much lower quality than the original weights. Is this the expected behavior?

Unfortunately, that's not the case. If you're using an RTX-4090, please try the following script. In the console window, press Ctrl+F and search for the keyword 'number' to check how many nodes are placed on the TensorRT or CUDA provider. If most nodes are placed on the GPU but you're still experiencing poor performance, it may be an issue with the ONNX Runtime.
import re
import sys
import time
import jieba
import numpy as np
import onnxruntime
import torch
import torchaudio
from pypinyin import lazy_pinyin, Style

F5_project_path      = "/home/dake/Downloads/F5-TTS-main"                               # The F5-TTS Github project download path.  URL: https://github.com/SWivid/F5-TTS
onnx_model_A         = "/home/dake/Downloads/F5_Preprocess.onnx"                        # The exported onnx model path.
onnx_model_B         = "/home/dake/Downloads/F5_Transformer.onnx"                       # The exported onnx model path.
onnx_model_C         = "/home/dake/Downloads/F5_Decode.onnx"                            # The exported onnx model path.

reference_audio      = "/home/dake/Downloads/F5-TTS-main/src/f5_tts/infer/examples/basic/basic_ref_en.wav"     # The reference audio path.
generated_audio      = "/home/dake/Downloads/F5-TTS-main/src/f5_tts/infer/examples/basic/generated.wav"        # The generated audio path.
ref_text             = "Some call me nature, others call me mother nature."             # The ASR result of reference audio.
gen_text             = "I am a super hero."                                             # The target TTS.

providers = [
    ('TensorrtExecutionProvider', {
        'device_id': 0,                                      # Select GPU to execute
        'trt_max_workspace_size': 4 * 1024 * 1024 * 1024,    # Set GPU memory usage limit, default is 4GB
        'trt_fp16_enable': True,                             # Enable FP16 precision for faster inference
    }),
    ('CUDAExecutionProvider', {
        'device_id': 0,
        'arena_extend_strategy': 'kNextPowerOfTwo',
        'gpu_mem_limit': 4 * 1024 * 1024 * 1024,
        'cudnn_conv_algo_search': 'EXHAUSTIVE',
        'do_copy_in_default_stream': True,
    }),
    'CPUExecutionProvider'
]

HOP_LENGTH = 256                        # Number of samples between successive frames in the STFT
SAMPLE_RATE = 24000                     # The generated audio sample rate
RANDOM_SEED = 9527                      # Set seed to reproduce the generated audio
NFE_STEP = 32                           # F5-TTS model setting
SPEED = 1.0                             # Set for talking speed. Only works with dynamic_axes=True

with open(f"{F5_project_path}/data/Emilia_ZH_EN_pinyin/vocab.txt", "r", encoding="utf-8") as f:
    vocab_char_map = {}
    for i, char in enumerate(f):
        vocab_char_map[char[:-1]] = i
vocab_size = len(vocab_char_map)

def is_chinese_char(c):
    cp = ord(c)
    return (
        0x4E00 <= cp <= 0x9FFF or    # CJK Unified Ideographs
        0x3400 <= cp <= 0x4DBF or    # CJK Unified Ideographs Extension A
        0x20000 <= cp <= 0x2A6DF or  # CJK Unified Ideographs Extension B
        0x2A700 <= cp <= 0x2B73F or  # CJK Unified Ideographs Extension C
        0x2B740 <= cp <= 0x2B81F or  # CJK Unified Ideographs Extension D
        0x2B820 <= cp <= 0x2CEAF or  # CJK Unified Ideographs Extension E
        0xF900 <= cp <= 0xFAFF or    # CJK Compatibility Ideographs
        0x2F800 <= cp <= 0x2FA1F     # CJK Compatibility Ideographs Supplement
    )

def convert_char_to_pinyin(text_list, polyphone=True):
    final_text_list = []
    merged_trans = str.maketrans({
        '“': '"', '”': '"', '‘': "'", '’': "'",
        ';': ','
    })
    chinese_punctuations = set("。，、；：？！《》【】—…")
    for text in text_list:
        char_list = []
        text = text.translate(merged_trans)
        for seg in jieba.cut(text):
            if seg.isascii():
                if char_list and len(seg) > 1 and char_list[-1] not in " :'\"":
                    char_list.append(" ")
                char_list.extend(seg)
            elif polyphone and all(is_chinese_char(c) for c in seg):
                pinyin_list = lazy_pinyin(seg, style=Style.TONE3, tone_sandhi=True)
                for c in pinyin_list:
                    if c not in chinese_punctuations:
                        char_list.append(" ")
                    char_list.append(c)
            else:
                for c in seg:
                    if c.isascii():
                        char_list.append(c)
                    elif c in chinese_punctuations:
                        char_list.append(c)
                    else:
                        char_list.append(" ")
                        pinyin = lazy_pinyin(c, style=Style.TONE3, tone_sandhi=True)
                        char_list.extend(pinyin)
        final_text_list.append(char_list)
    return final_text_list

def list_str_to_idx(
    text: list[str] | list[list[str]],
    vocab_char_map: dict[str, int],  # {char: idx}
    padding_value=-1
):
    get_idx = vocab_char_map.get
    list_idx_tensors = [torch.tensor([get_idx(c, 0) for c in t], dtype=torch.int32) for t in text]
    text = torch.nn.utils.rnn.pad_sequence(list_idx_tensors, padding_value=padding_value, batch_first=True)
    return text

# ONNX Runtime settings
onnxruntime.set_seed(RANDOM_SEED)
session_opts = onnxruntime.SessionOptions()
session_opts.log_severity_level = 0  # error level, it a adjustable value.
session_opts.inter_op_num_threads = 0  # Run different nodes with num_threads. Set 0 for auto.
session_opts.intra_op_num_threads = 0  # Under the node, execute the operators with num_threads. Set 0 for auto.
session_opts.enable_cpu_mem_arena = True  # True for execute speed; False for less memory usage.
session_opts.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL
session_opts.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
session_opts.add_session_config_entry("session.intra_op.allow_spinning", "1")
session_opts.add_session_config_entry("session.inter_op.allow_spinning", "1")

ort_session_A = onnxruntime.InferenceSession(onnx_model_A, sess_options=session_opts, providers=['CPUExecutionProvider'])
model_type = ort_session_A._inputs_meta[0].type
in_name_A = ort_session_A.get_inputs()
out_name_A = ort_session_A.get_outputs()
in_name_A0 = in_name_A[0].name
in_name_A1 = in_name_A[1].name
in_name_A2 = in_name_A[2].name
out_name_A0 = out_name_A[0].name
out_name_A1 = out_name_A[1].name
out_name_A2 = out_name_A[2].name
out_name_A3 = out_name_A[3].name
out_name_A4 = out_name_A[4].name
out_name_A5 = out_name_A[5].name
out_name_A6 = out_name_A[6].name

ort_session_B = onnxruntime.InferenceSession(onnx_model_B, sess_options=session_opts, providers=providers)
in_name_B = ort_session_B.get_inputs()
out_name_B = ort_session_B.get_outputs()
in_name_B0 = in_name_B[0].name
in_name_B1 = in_name_B[1].name
in_name_B2 = in_name_B[2].name
in_name_B3 = in_name_B[3].name
in_name_B4 = in_name_B[4].name
in_name_B5 = in_name_B[5].name
in_name_B6 = in_name_B[6].name
out_name_B0 = out_name_B[0].name

ort_session_C = onnxruntime.InferenceSession(onnx_model_C, sess_options=session_opts, providers=['CPUExecutionProvider'])
in_name_C = ort_session_C.get_inputs()
out_name_C = ort_session_C.get_outputs()
in_name_C0 = in_name_C[0].name
in_name_C1 = in_name_C[1].name
out_name_C0 = out_name_C[0].name

# Run F5-TTS by ONNX Runtime
audio, sr = torchaudio.load(reference_audio)
if sr != SAMPLE_RATE:
    resampler = torchaudio.transforms.Resample(orig_freq=sr, new_freq=SAMPLE_RATE)
    audio = resampler(audio)
audio = audio.unsqueeze(0).numpy()
if "float16" in model_type:
   audio = audio.astype(np.float16)
zh_pause_punc = r"。，、；：？！"
ref_text_len = len(ref_text.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, ref_text))
gen_text_len = len(gen_text.encode('utf-8')) + 3 * len(re.findall(zh_pause_punc, gen_text))
ref_audio_len = audio.shape[-1] // HOP_LENGTH + 1
max_duration = np.array(ref_audio_len + int(ref_audio_len / ref_text_len * gen_text_len / SPEED), dtype=np.int64)
gen_text = convert_char_to_pinyin([ref_text + gen_text])
text_ids = list_str_to_idx(gen_text, vocab_char_map).numpy()
time_step = np.array(0, dtype=np.int32)

print("\n\nRun F5-TTS by ONNX Runtime.")
start_count = time.time()
noise, rope_cos, rope_sin, cat_mel_text, cat_mel_text_drop, qk_rotated_empty, ref_signal_len = ort_session_A.run(
        [out_name_A0, out_name_A1, out_name_A2, out_name_A3, out_name_A4, out_name_A5, out_name_A6],
        {
            in_name_A0: audio,
            in_name_A1: text_ids,
            in_name_A2: max_duration
        })
while time_step < NFE_STEP:
    print(f"NFE_STEP: {time_step}")
    noise = ort_session_B.run(
        [out_name_B0],
        {
            in_name_B0: noise,
            in_name_B1: rope_cos,
            in_name_B2: rope_sin,
            in_name_B3: cat_mel_text,
            in_name_B4: cat_mel_text_drop,
            in_name_B5: qk_rotated_empty,
            in_name_B6: time_step
        })[0]
    time_step += 1
generated_signal = ort_session_C.run(
        [out_name_C0],
        {
            in_name_C0: noise,
            in_name_C1: ref_signal_len
        })[0]
end_count = time.time()

# Save to audio
audio_tensor = torch.tensor(generated_signal, dtype=torch.float32).squeeze(0)
torchaudio.save(generated_audio, audio_tensor, SAMPLE_RATE)

print(f"\nAudio generation is complete.\n\nONNXRuntime Time Cost in Seconds:\n{end_count - start_count:.3f}")

The key message is as follows:
'''
2024-11-16 00:19:29.0229437 [V:onnxruntime:, session_state.cc:1151 onnxruntime::VerifyEachNodeIsAssignedToAnEp] All nodes placed on [CPUExecutionProvider]. Number of nodes: 4312
'''
It shows all F5_Transformer.onnx nodes are running on the CPU, and the performance of '48.918 seconds' seems acceptable for the CPU provider. Ensure that the latest onnxruntime-gpu==1.20.0 is installed correctly and has worked previously; any remaining issues are unclear to me as well.


add GCM instead of CBC

fix security issue because CBC encryption not secure:
https://github.com/MobSF/owasp-mstg/blob/master/Document/0x04g-Testing-Cryptography.md#identifying-insecure-andor-deprecated-cryptographic-algorithms-mstg-crypto-4

You can already use GCM using the AndroidOptions parameter. See https://github.com/mogol/flutter_secure_storage/blob/develop/flutter_secure_storage/lib/options/android_options.dart

I know, but when using a security tool gives an alert of using CBC encryption in getCipher method :
https://github.com/beshoy97/flutter_secure_storage/commit/1fab5256f51fa8d38227408f61cb2af393d83295
CBC encryption vulnerabilities:
https://learn.microsoft.com/en-us/dotnet/standard/security/vulnerabilities-cbc-mode


If Microsoft EDGE is still required, then the Bing protocol has not yet been reverse engineered?

If Microsoft EDGE is still required, then the Bing protocol has not yet being reverse engineered.
Can you get rid of the EDGE requirement? So that we can run it on a Linux machine for example.

You don't need Edge, only to retrieve the cookies in order to authenticate with the endpoints. acheong08 has built this library on top of these endpoints.

Also, just as a heads up, you can absolutely run Edge on Linux.  It's just another Chromium reskin after all.  Here's the stable branch on the AUR for example: https://aur.archlinux.org/packages/microsoft-edge-stable-bin
Works just fine for the purposes of obtaining the required cookie.

I was talking about headless linux machines.

As I said, you don't need it at all. Retrieve the cookies from another computer and copy them to the machine running EdgeGPT. I have a telegram bot running EdgeGPT in a headless server, I only copied the cookies file there.

And just to follow-up on this, I actually didn't read the instructions that closely the first time as the whole process went so smoothly (on a non headless server mind you) that I didn't need to, but looking back I can't see any reason Edge would be necessary at all?  I just checked to make sure and I was able to get a working cookie from Chrome and Firefox just the same as Edge, and in fact now that I'm looking more closely, the instructions themselves even say get the cookie with Firefox or Chrome;  Edge is only mentioned for verification purposes that you actually have access to BingChat in the first place, which I can only assume is there in an attempt by  acheong08 to try and cut down on some of the inevitable "why isn't this working" comments from people who never had access to BingChat in the first place.  So yeah, get the cookie from any Chromium or Firefox based browser that strikes your fancy on the headed computer of your choice and just copy it too your headless setup.  Easy peasy.

It's not required. You just need it for getting access to the cookies


Add color constants

Nice to have?

Going to merge this version for easiness to write and consistency with the already top level direction constants, but interested to revisit and possibly make all constants namespaced on next breaking release


python3Packages.flax build failure on x86_64-linux as of 035c3601

Issue description
Build of python3Packages.flax failed on x86_64-linux as of 035c36013683560abab6a9252bb9cc3657e79cdd.
build log
Maintainer cc: @ndl
Other cc: n/a
Steps to reproduce

Checkout nixpkgs at commit 035c36013683560abab6a9252bb9cc3657e79cdd
Run nix-build -A python3Packages.flax

Technical details
- system: `"x86_64-linux"`
 - host os: `Linux 5.11.0-1028-azure, Ubuntu, 20.04.3 LTS (Focal Fossa)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.6.1`
 - nixpkgs: `/nix/store/6v2wg6ycxzrqwn5g2pxfvx5700vddq9a-source`

Misc.
This issue was automatically generated by nixpkgs-upkeep.

CI workflow that created this issue.
Internal tag:<PHONE_NUMBER>068475253

likely due to https://github.com/NixOS/nixpkgs/issues/161822


⚠ Bofrost.es has degraded performance

In f29758b, Bofrost.es (https://www.bofrost.es) experienced degraded performance:

HTTP code: 200
Response time: 1389 ms

Resolved: Bofrost.es performance has improved in f501757 after 8 minutes.


CORS for requests to /api/lessons

Problem
JS3's demo https://songz.c0d3.com/js3/req.html does not show the lessons because when it sends a request to /api/lessons because our API does not have an 'Access-Control-Allow-Origin' header set, which would indicate that requests from 'https://songz.c0d3.com/' are allowed.
Expected behaviour
API can be accessed from anywhere / API should allow *.c0d3.com requests
Actual behaviour
API responds with CORS error

After investigating the issue, we need to go over Vercel's configs because the API sets the header to *.

The issue seem to only happen when a request is sent to the domain https://c0d3.com/api/lessons but not https://v2.c0d3.app/api/lessons

Setting the header in our nginx redirection redirect-to-www on CapRover's resolves the issue.


Log4j Dated Rolling File Appender

Dated rolling log appender to support file name created with the date and also cleanup old log files
Overwritten super.subAppend to handle newline character in the message and a new separator for the exception stack trace
Committer Checklist (excluded from commit message)

[ ] Verify design and implementation
[ ] Verify test coverage and CI build status
[ ] Verify documentation (including upgrade notes)

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.:x: senthilm-ms sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.


Where does the L object come from?

When I import some components like
import {
  LMap,
  LTileLayer,
  LMarker,
  LPolygon,
  LPolyline,
  LPopup
} from "vue2-leaflet";

I'm able to access an L object, with methods like DomEvent, control, and Icon. Is this somehow made global when importing LMap? I'm using ESLint and it's not liking the lack of definition for it. I could write in an exception, but I was curious myself how I'm able to access it. I only know of it from copying examples in the repo.

Vue leaflet instantiate leaflet which at the version that is used attach itself to the window object. Thus you are able to use it

@hpo14  We work with Nuxt as well, to run it on nuxt you need 2 things:
1)
A js file in your plugins folder ( say the name is : vue-leaflet.js )
Add this in your file:
import Vue from 'vue';
import Vue2Leaflet from 'vue2-leaflet';

import L from 'leaflet';
delete L.Icon.Default.prototype._getIconUrl;

L.Icon.Default.mergeOptions({
  iconRetinaUrl: require('leaflet/dist/images/marker-icon-2x.png'),
  iconUrl: require('leaflet/dist/images/marker-icon.png'),
  shadowUrl: require('leaflet/dist/images/marker-shadow.png')
});

Vue.component('l-map', Vue2Leaflet.LMap);
Vue.component('l-tilelayer', Vue2Leaflet.LTileLayer);
Vue.component('l-marker', Vue2Leaflet.LMarker);
Vue.component('l-tooltip', Vue2Leaflet.LTooltip);
Vue.component('l-popup', Vue2Leaflet.LPopup);
Vue.component('l-control-zoom', Vue2Leaflet.LControlZoom);
Vue.component('v-marker-cluster', Vue2LeafletMarkerCluster);
Vue.component('l-geo-json', Vue2Leaflet.LGeoJson);
Vue.component('l-feature-group', Vue2Leaflet.LFeatureGroup);

@lordfuoco thank you
I'll try your method later i get home. And make response for the result.
https://github.com/schlunsen/nuxt-leaflet
I also found this github and follow steps, and result is a page of blank (?)
If look from the Chrome DevTools, it actual generate the map (look like it DO really generate it)
But from Devtool''s [Network Tab], my page doesnt send any req to tile.osm.org, that's wired.
Am i do anything wrong ?

@hpo14 if this is resolved can you please close the issue ?


make a table or resource of when to use what function with a vector or a dataframe

the inconsistency in R makes it really confusing for people
also maybe add to this resource the common error of data %>% pull(variablename) %>% range(variabelname)

@avahoffman  what do you think about this?

I think this would be great on the help page! That, and the table of quotations/ticks by function.

We have these both on the help page:
When should I use quotes (““) or backticks (``)?
Check out our Guide on when to use quotes or backticks.
How do I know when to use the pull() function, instead of just using select()?
Check out our Guide on what functions require pulling values out first.

it's also on our resources page: