Add support for custom allocators

Overview
Addresses the proposal in #372.
It indeed took a while until I got around to implement it and this change turned out to be more involved than I expected...
Disclaimer
I am mainly a C++ developer and only rarely write pure C. I tried to stick to the coding style / naming conventions / etc. used throughout MIR but I might have missed some things. You have been warned :-)
Implementation
The general purpose memory management routines (malloc, calloc, realloc, free) are bundled in struct MIR_alloc, which is just a collection of function pointers and some user data. Similarly, function pointers to executable code related memory management functions (mem_map, mem_unmap, mem_protect) are bundled in MIR_code_alloc.
Users wanting to provide custom allocators can do so by calling newly introduced function MIR_init2 (name to be discussed), which takes pointers to both a MIR_alloc and a MIR_code_alloc. Both can be NULL, which results in a default implementation being used. Both pointers are persisted in the MIR_context (fields alloc and code_alloc) for easy consumption by other functions.
The following convenience functions are provided to work with allocators and replace the "raw" functions of corresponding name:

void *MIR_malloc (MIR_alloc_t alloc, size_t size)
void *MIR_calloc (MIR_alloc_t alloc, size_t num, size_t size)
void *MIR_realloc (MIR_alloc_t alloc, void *ptr, size_t old_size, size_t new_size) (a little different than plain realloc, see next section)
void MIR_free (MIR_alloc_t alloc, void *ptr)

Similarly, for the executable code management functions:

void *MIR_mem_map (MIR_code_alloc_t code_alloc, size_t len)
int MIR_mem_unmap (MIR_code_alloc_t code_alloc, void *ptr, size_t len)
int MIR_mem_protect (MIR_code_alloc_t code_alloc, void *ptr, size_t len, MIR_mem_protect_t prot)

I initially planned to only feed MIR_alloc into the MIR_context and feed MIR_code_alloc instead into MIR_gen_init, but this turned out to be impossible without yet more involved refactorings.
As it currently stands, the core API (exposed by mir.h, mir-gen.h, etc.) did not change, i.e. existing projects should compile and run just like before without requiring any changes. Internal APIs (like mir-varr.h, mir-htab.h, etc.) did however change, though I tried to keep these to a minimum. More on this in the next section.
Potentially Controversial Design Decision
VARRs keep a pointer to their allocator
Both VARRs and HTABs (as well as bitmaps) now require passing an allocator when calling their create functions. I wanted to avoid also passing allocators when invoking other operations that might need to manage memory (push, expand, destroy, ...), as this would have severly cluttered the API.
Instead, I opted for VARRs storing an additional pointer to the allocator which was passed in when creating them, which is then used for further operations. Slightly increases their memory footprint though.
realloc takes the previous size as an additional parameter
Alternative title: C's and C++'s allocation APIs are not friends.
As I mentioned initially, I come from a C++ background. When designing the allocator interface for MIR, I tried to do it in a way that would also play somewhat nicely with what C++ has to offer. Sadly, what C++ has to offer is less than spectacular: std::allocator is a complete mess and its intended replacement std::pmr::polymorphic_allocator / std::pmr::memory_resource shares some of its quirks:

Both do not support a realloc-style operation
Both require users to pass the size of the allocation when calling deallocate

To support as wide a range of allocators as possible without complicating the API too much, I opted for the following compromise:

MIR_realloc takes the previous size as an additional parameter. This allows allocator implementations to translate calls to MIR_realloc into a allocate - memcpy - free sequence. As MIR_realloc is only called inside mir-varr.h, required changes on MIR's part were minimal.
MIR_free on the other hand does not take the previous size. This would have required a lot of changes on MIR's part as there are a decent amount of allocations whose size is dynamically determined at runtime. Users wishing to use an API requiring this will need to do their own bookkeeping.

Of course, we could always go more into one or the other direction and:

go with a fully C-style allocation interface, removing the quirks of MIR_realloc
go with a fully C++-style allocation interface and only provide MIR_alloc / MIR_free, requiring VARR to always copy manually upon expansion
or something other in between... Ah the choices :-)

Documentation
I added some documentation, both for users of MIR as a library as well as developers of MIR, in CUSTOM-ALLOCATORS.md.
Testing
This is partly covered by the existing tests, though it may be nice to add some allocator specific ones. While it would be pretty straightforward to test that a given allocator has been called, the other way around (ensuring that malloc, free, etc. are not called when a custom allocator is passed) is a bit harder. Not sure if there is some cross platform magic to override malloc and the others...
Things I am unsure about

Thread safety: As far as I can tell, users supplying custom allocators wishing to call MIR from multiple threads simply need to ensure their supplied functions are thread safe.

Conclusion
I hope this fits MIR and my ramblings did not scare you away already :-)
Let me know if there are things that need improvement / polish.

Users wanting to provide custom allocators can do so by calling newly introduced function MIR_init2 (name to be discussed), which takes pointers to both a MIR_alloc and a MIR_code_alloc. Both can be NULL, which results in a default implementation being used. Both pointers are persisted in the MIR_context (fields alloc and code_alloc) for easy consumption by other functions.

Thank you for providing the compatibility.

As it currently stands, the core API (exposed by mir.h, mir-gen.h, etc.) did not change, i.e. existing projects should compile and run just like before without requiring any changes. Internal APIs (like mir-varr.h, mir-htab.h, etc.) did however change, though I tried to keep these to a minimum. More on this in the next section.

I don't consider mir-varr etc as part MIR API.  So it is ok to me.

Documentation

Thank you for providing a good documentation (I'll fix one typo later)

Things I am unsure about
* **Thread safety:** As far as I can tell, users supplying custom allocators wishing to call MIR from multiple threads simply need to ensure their supplied functions are thread safe.

I think it is quite reasonable.  All widely-used allocators already implement this feature and it should be if the allocator need to be high performant as providing thread-safety affect the allocator design.

Conclusion
I hope this fits MIR and my ramblings did not scare you away already :-) Let me know if there are things that need improvement / polish.

It is a big step forward.  I think we will have time to polish it after getting feedback from MIR users.  We need to finalize this only before the next MIR release which probably will not happen this year.
I think you should add yourself (as first person) to copyright to the new files.  If you don't want it, you can add yourself as an author.
Thank you very much for the PR.  I consider your API choices reasonable and most probably I'd made the analogous ones.
You did a big and good job.  It is actually the biggest PR I received for MIR-project.
I merged the PR but found some problems.  The biggest one is parallel bootstrap failure.  So I reverted the patch.  I'll continue to work on the patch and the PR you just sent recently on the next week.  I feel it is important to add this code to MIR-project.

Thank you very much for the PR. I consider your API choices reasonable and most probably I'd made the analogous ones.
You did a big and good job.

Glad to hear that, happy I can contribute  :-)

I think you should add yourself (as first person) to copyright to the new files. If you don't want it, you can add yourself as an author.

I have seen other projects adopt an AUTHORS.md file, e.g. the Godot Engine. They then proceed to simply reference that in their copyright, e.g. like so  (for Godot they also break down the different development periods, not sure if that is necessary):
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */

I do not feel particularly strong for any of these, so either would work for me (copyright / author / AUTHORS.md). The latter probably scales better for larger projects.

I'll continue to work on the patch and the PR you just sent recently on the next week.

Let me know if I can be of help :-)


the detail of function "get_predicted_texture" in texture.py

Hello, thanks for your share,
I can't find the Additional Results Section B.3 of the paper,
and when I tried to read the code, I can't understand the detail of  function "get_predicted_texture" in texture.py，could you give me some advice?
Thanks a lot!

Hello. Thank you for checking out the repository. Please refer to this PDF page no 11/14 (https://arxiv.org/pdf/1701.04851.pdf). Here, you will find the Additional Results Section B.3. Go through it and it will help you to understand the function "get_predicted_texture".

Thanks for your reply, but I still can't understand this formula, could you explain it for me?
Thanks a lot!!!

distances = []
for i in range(0, vertices_len):
			vertice1 = vertices[i,:]
			vertice2 = vertices[8317,:]
			distances.append(sqrt(pow(vertice2[0]-vertice1[0],2) + pow(vertice2[1]-vertice1[1],2) + pow(vertice2[2]-vertice1[2],2)))

8317 is the index of the nose vertex and distance of each vertex is calculated from nose vertex and appended in the list of distances.
minimum = min(distances)
maximum = max(distances)

		for i in range(0, vertices_len):
			distances[i]=abs(((distances[i]-minimum)/(maximum-minimum)) - 1);
			distances[i]=(distances[i] * range1)

Here we are normalizing all the distances. range1 variable tells us the weightage of the predicted texture during interpolation.
weight1 = []
		for i in range(0,len(distances)):
			weight1.append(distances[i])
			weight1.append(distances[i])
			weight1.append(distances[i])

		weight2 = np.array([weight1]*np.shape(tex_PC)[1])
		weight1 = np.array(weight1)
		weight2 = np.transpose(weight2)

Here we are appending all the distances 3 times since each vertex has 3 coordinates to the weight1 list in order to get a list of 160K length. We need to multiply this list with the Texture Principal components that is "B" in equation 10 of the paper. So we generate an array having the shape of 160K x 199 and then transpose it to get the weight2 matrix having shape 199 x 160K.
tex_MU = np.reshape(tex_MU,np.shape(tex_MU)[0])
tex_lhs = np.transpose(np.multiply(tex_PC, weight2))
tex_rhs = np.multiply((tex_Cp - tex_MU), weight1)
tex_z = np.matmul(tex_lhs,tex_rhs)

Here is the code of the screenshot you posted.


Construct comment section and enable user log in

This PR contains a comment section made for week 3 tutorial, which should be included in the last PR. It also requires the user to log in with gmail before he/she makes a comment.
Comment section contains a button to log in, a form to collect user input, and a div to display all comments. If the user is not logged in, only the log in button will be displayed in the page. After the user logs in, he/she can choose either leave a comment, or see 1 to 5 comments. The user can delete the comment by clicking "goawayplease" button. To change their log in email, they can log out by clicking "logouthere" button and log in again. Comments are sorted in descending order. Besides, there are some style changes in CSS file, and some pictures are added to the images folder.
The page is deployed at https://lujiez-step-2020.appspot.com/index.html.

FYI, the page is deployed at https://lujiez-step-2020.appspot.com/index.html.


version bump

There are some changes made, mainly the removal of alias_chain_method that throw some deprecation warnings in Rails 5, that are not being applied due to the lack of a version bump.

Just shipped 1.2.0, thanks.


Fix  typescript definition & Revert use of forked library

Motivation/error explained in Issue #3209
This PR switches native-base back to the upstream version of react-native-keyboard-aware-scroll-view in order to fix typescript errors on the  component.  It was nice of @codler to provide a quick fix for RN 0.63, but since the fix was incompletely implemented, and the upstream repository has active maintenance, I think it's appropriate to switch back to the main library.
Thanks for reading!

TO DISCUSS:
NativeBase uses a combination of locked, semver-compat ("^version"), and minor-version ("~version") specifications for dependencies. I used a locked version to match the previous style, but perhaps the version of react-native-keyboard-aware-scroll-view could be minor-version unlocked?
It seems that more minor deprecations & changes may be coming (see here: https://github.com/APSL/react-native-keyboard-aware-scroll-view/issues/440), so perhaps unlocking the version could allow consuming apps to receive the minor patches without requiring a NativeBase update.
Let me know what you think.

@davidgovea A simialr PR with the fix has already been merged


Update aggregates before writing response using HTTP endpoints and the aggregate workflow

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When using the aggregate workflow and HTTP endpoints it would be nice if the handler wrapper would apply the changes to the aggregate before it is returned.
For example, lets say I have the following http endpoint:
    [Transactional]
    [WolverinePost("/sidekicks/{sidekickId}/rename/{name}")]
    public static (Sidekick, SidekickRenamed) HandleAsync(
        Guid sidekickId,
        string name,
        [Aggregate("sidekickId")] Sidekick sidekick
    )
    {
        var renamed = new SidekickRenamed(sidekickId, name);
        return (sidekick, renamed);
    }

Currently this will return the state of the sidekick without the rename event applied. The current work around is to do something like this:

    [Transactional]
    [WolverinePost("/sidekicks/{sidekickId}/rename/{name}")]
    public static (Sidekick, SidekickRenamed) HandleAsync(
        Guid sidekickId,
        string name,
        [Aggregate("sidekickId")] Sidekick sidekick
    )
    {
        var renamed = new SidekickRenamed(sidekickId, name);
        return (sidekick with { Name = name }, renamed);
    }

Which is to actually apply the event yourself, which is not ideal.
Note: I have tried using IdentitySessions and it still did not seems to update the aggregate before writing the HTTP response.

In general you need to validate if the event actually can be applied. Best way to do this is to actually try. Maybe the sidekick can not be renamed after it choose a superpower? In this case you should not apply the renamed event to the stream.
`
[Transactional]
[WolverinePost("/sidekicks/{sidekickId}/rename/{name}")]
public static (Sidekick, SidekickRenamed) HandleAsync(
Guid sidekickId,
string name,
[Aggregate("sidekickId")] Sidekick sidekick
)
{
var @event = new SidekickRenamed(sidekickId, name);
sidekick.Apply(@event); // okay, this only works with the projection on the aggregate itself.
    return (sidekick, @event);
}

`
This way you keep your sidekick logic in one place. Or even more domain driven and projection independend:
`
[Transactional]
[WolverinePost("/sidekicks/{sidekickId}/rename/{name}")]
public static (Sidekick, SidekickRenamed) HandleAsync(
Guid sidekickId,
string name,
[Aggregate("sidekickId")] Sidekick sidekick
)
{
var @event = sidekick.Rename(name);
    return (sidekick, @event);
}

public class Sidekick {
...
public SidekickRenamed Rename(string name) {
if(name.length < 3) throw InvalidArgumentException(...);
 this.name = name;
 return new SidekickRenamed(this.id, this.name);

}
public void Apply(SidekickRenamed @event) {
this.Rename(@event.name);
}
}
`
I personally dont see the point in an integrated auto apply, but maybe there is a clever solution which works out of the box for most cases?

Related to #935, or at least do these things together

@Arne-B The assumption here is that you would be doing the validation already within the handler method. @rena0157 omitted it in this particular case, but doing the auto-update would not prevent you from doing the validation upfront. If you had to do the validation with the resulting aggregate, then you're out of luck and you'd need to do something explicit instead of the aggregate handler workflow

Notes

If the aggregate in question is Live, take the initial version, then apply the events in memory to it using the session
If the aggregate in question is Inline, update the reference through a LoadAsync(). You need to reload it just in case it's immutable and replaced

Test Cases

[ ] Live aggregate
[ ] Inline, mutable
[ ] Inline, immutable

This is all possible now with the UpdatedAggregate type in 3.5


Improve doc logic

This PR changes the way a part of the document logic is managed. It mainly refactors some of the state variables. This change allows to change the backdrop logic in such a way that the backdrop doesn't blink when entering a workspace.

Codecov Report

Merging #383 (b08e929) into main (c31668e) will not change coverage.
The diff coverage is n/a.

:exclamation: Current head b08e929 differs from pull request most recent head 67de912. Consider uploading reports for the commit 67de912 to get more accurate results

@@           Coverage Diff           @@
##             main     #383   +/-   ##
=======================================
  Coverage   81.67%   81.67%
=======================================
  Files          61       61
  Lines        4066     4066
=======================================
  Hits         3321     3321
  Misses        745      745

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Update Get-CalendarDiagnosticObjects.md

@chrisda  -- here's the edit in the second file.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

exchange/exchange-ps/exchange/mailboxes/Get-CalendarDiagnosticObjects.md
:white_check_mark:Succeeded
View (exchange-ps)

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Remove duplicate code

+1 thanks @julien-c

Thanks for merging and for pushing a release @desmondmorris :)


Complete Browser Crash on platform.thatopen.com

Describe the bug 📝
When opening specific models, the whole Chrome browser crashes (all tabs are closed).
If I enable verbose logging, there's nothing valuable to debug.
To be honest I'm not sure if this is an OBC or web-ifc issue. I'm at least experiencing it on platform.thatopen.com and also on my local IFC viewer built with OBC.
Also it's quite critical because all progress in every tab is lost. The crash sometimes only comes after minutes, so might be doing something completely different by that time.
Reproduction ▶
https://platform.thatopen.com/app
Steps to reproduce 🔢

Go to https://platform.thatopen.com/app
Open the attached model
Wait for 10s to 8min and the browser completely crashes

I can only reproduce this on MacOS and only with a few models, which are exported from Revit to IFC into Desite and then back to IFC.
Download crash-model.ifc
System Info 💻
System:
    OS: macOS 14.1
    CPU: (14) arm64 Apple M3 Max
    Memory: 205.73 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.0 - ~/Library/pnpm/node
    npm: 10.2.3 - ~/Library/pnpm/npm
    pnpm: 8.12.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 120.0.6099.199
    Safari: 17.1
  npmPackages:
    openbim-components: 1.2.0 => 1.2.0

Used Package Manager 📦
pnpm
Error Trace/Logs 📃

Attached chrome debug log does not show anything to worry about
[29790:259:0103/201406.416530:WARNING:chrome_main_delegate.cc(667)] This is Chrome version 120.0.6099.129 (not a warning)
[29790:259:0103/201406.498783:VERBOSE1:statistics_recorder.cc(647)] Collections of all histograms
Histogram: Chrome.ProcessSingleton.NotifyResult recorded 1 samples, mean = 1.0 (flags = 0x41)
0  O                                                                         (0 = 0.0%)
1  -O                                                                        (1 = 100.0%) {0.0%}
2  ...

Histogram: Chrome.ProcessSingleton.TimeToNotify recorded 1 samples, mean = 9.0 (flags = 0x41)
0  -O                                                                        (1 = 100.0%)
10 ...

Histogram: UMA.PersistentAllocator.BrowserMetrics.Errors recorded 0 samples (flags = 0x41)
0 ...

Histogram: UMA.PersistentAllocator.BrowserMetrics.UsedPct recorded 0 samples (flags = 0x41)
0 ...

Histogram: UMA.PersistentHistograms.InitResult recorded 1 samples, mean = 2.0 (flags = 0x41)
0  ...
2  -O                                                                        (1 = 100.0%) {0.0%}
3  ...

Validations ✅

[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
[X] Check that this is a concrete bug. For Q&A join our Community.
[X] The provided reproduction is a minimal reproducible example of the bug.

Hey @NiklasPor!
Just to let you know I have tested the browser crash and failed successfully haha, what I mean is that I have opened your model in both the platform app and a local app and in neither case the browser crashed. I let the tab opened for like 2 hours (in fact, I forget it at one moment). The most obvious different thing is that I'm on Windows, not Mac. I'm not able to test it on Mac, are you able to test it on Windows?

We checked it on windows and can only replicate it on MacOS.

Well, I can't access a Mac to test it, so it's pretty hard to debug for me. Let's hope some other person help us with this 🙏

No worries, it largely seems to appear after I had worked for a longer time, so maybe some memory leak. Nearly all of our users are also on Windows, so I'm not worried, just wanted to document so that we can get it fixed at some point 😆

https://github.com/IFCjs/web-ifc/releases/tag/0.0.49 includes "fixes a memory leak" – I'll check if my chrome is still crashing on macos 👀

The 0.0.49 memory-leak fix does not seem to affect the crashing behaviour, but I also tested in Firefox and got no crashes there ever (while chrome crashes mostly in minutes) 😁

Hey Niklas!
Knowing it doesn't crashes on Windows, and in MacOS only seems to crash in Chrome, I did a quick search on Google and it seems that many people report Chrome crashes on Mac.
Would it be something related to the MacOS version of Chrome?

I really don't know what it is (this is also the only page which crashes my browser) and I'm working with chrome about 9+ hours per day 😁
So I sure think that the bug is exclusive Chrome on MacOS (probably also only on the ARM macs?). No idea how to validate and fix this – might even be a bug in Chrome and not in OB components 👀

This is a bit hard for us to reproduce, so I'm closing this for now. We have made a huge update to the libraries lately, so hopefully that has solved the issue. Let us know otherwise!


”Racova”, ”Sechereșa”, ”Supuru de Sus” are listed in the drop-down menu

Description:
When user writes ”Racova”, ”Sechereșa”, ”Supuru de Sus” the locations appear in the drop-down menu next to the comune and the county which is a part according to the law.
Precondition:
The website is up an running.

Step 1
Write in the search bar "Racova"

Expected results
The location appears in the drop-down menu as "Sat Racova, SATU MARE (Supur)".

Step 2
Press "x" button.

Expected results
The location was deleted from the search bar.

Step 5
Write in the search bar "Supuru de Sus"

Expected results
The location appears in the drop-down menu as "Sat Supuru de Sus, SATU MARE (Supur)".


Filter values for related resources are wrapped in nested arrays?

I'm a little confused as to what's going on, but upgrading from 0.8.3 to 0.9 broke some filters I have in place. e.g.:
VERIFY_RADIUS_FILTER = ->(value, context) {
  return NoLimit.new unless context[:current_location].present?

  value
}

FILTER_RADIUS_FROM_LOCATION = ->(records, value, options) {
  location = options.dig(:context, :current_location)
  limit = Array(value).first

  return records unless location.present? && limit.present?

  records.near(location, Float(limit))
}

filter :radius, default: 100.0,
                verify: VERIFY_RADIUS_FILTER,
                apply: FILTER_RADIUS_FROM_LOCATION

I think this commit my be the culprit? https://github.com/cerebris/jsonapi-resources/commit/3a691b29adb3e7aff0743ef59e44556bedb260c9
From what I can tell, this results in Resource#verify_resource being called twice. For a custom filter, at least (which is what I've got), that means the raw value gets doubly-nested in an array: https://github.com/cerebris/jsonapi-resources/blob/19f4d7b59f92b05fa28c4f925391cf5998123308/lib/jsonapi/resource.rb#L753
Instead I wonder if that line should be something like:
filter_values += raw.is_a?(String) ? CSV.parse_line(raw) : Array(raw)

To make sure we don't wrap an array?
/cc @hidde-jan

From what I can tell, this results in Resource#verify_filters being called twice.

I think this is the bug. Resource#verify_filters should only be called once. Can you find out where it is called for a second time? If we make Resource#verify_filters idempotent (which it should be), without fixing the underlying issue than we just fix the symptoms but not the bug.

I think it's happening in the RequestProcessor. The change was originally made on master, here: https://github.com/cerebris/jsonapi-resources/pull/971/files, and it including changing the ReqestProcessor#setup_get_related_resources_action so that it no longer called verify_filters b/c it was moved to the Processor#show_related_resources. But in the release-0-9 branch history, the functionality was cherry-picked over. But not all of the change made it - probably due to some extensive refactoring in the RequestProcessor. see: https://github.com/cerebris/jsonapi-resources/commit/3a691b29adb3e7aff0743ef59e44556bedb260c9
Anyhow, I think I have a handle on it now. I'm going to confirm things work as expected in master, and if so, open a PR against the release-0-9 branch to fix the back port. Sound reasonable?

Sounds great 👍 the cherry pick indeed skipped over that file, but it's required for things to work properly.


Assertion failed error with larger file s3 putObject

This code crashes. (Using main branch.)
func testS3ErrorBigFile() {
    let cpf: CredentialProviderFactory = .static(accessKeyId: "..."
                                                 secretAccessKey: "...")
    let awsClient = AWSClient(credentialProvider: cpf, httpClientProvider: .createNew)
    let s3 = S3(client: awsClient, region: .useast1)

    let data = Data(count: 17_000_000)
    let bb = ByteBuffer(data: data)
    let chunkSize = 100_000
    var idx = 0
    let payload = AWSPayload.stream(size: bb.readableBytes) { eventLoop in
        print("Sending chunk at \(idx)")
        let nRemaining = bb.readableBytes - idx
        let len = min(nRemaining, chunkSize)
        let chunk = bb.viewBytes(at: idx, length: len)!
        idx += chunkSize
        return eventLoop.makeSucceededFuture(.byteBuffer(ByteBuffer(chunk)))
    }
    let req = S3.PutObjectRequest(body: payload, bucket: "...", key: "...")
    let fut = s3.putObject(req)
    do {
        try fut.wait()
    } catch {
        print("Unexpected error \(error.localizedDescription)")
    }

    try! awsClient.syncShutdown()
}

Can't seem to get around this with a s3.multipartUpload either. This also crashes. Am I using it incorrectly?
func testS3ErrorBigFileMultipart() {
    let cpf: CredentialProviderFactory = .static(accessKeyId: "...",
                                                 secretAccessKey: "...")
    let awsClient = AWSClient(credentialProvider: cpf, httpClientProvider: .createNew)
    let s3 = S3(client: awsClient, region: .useast1)

    let data = Data(count: 17_000_000)
    let entireBB = ByteBuffer(data: data)
    let chunkSize = 200_000
    let partSize = 5_000_000
    var partIdx = 0

    let req = S3.CreateMultipartUploadRequest(bucket: "...", key: "test-error")
    let fut = s3.multipartUpload(req) { eventLoop in
        let thisPartIdx = partIdx
        let partStart = partIdx * partSize
        let remaining = entireBB.readableBytes - partStart
        let partLen = min(remaining, partSize)
        let partBBView = entireBB.viewBytes(at: partStart, length: partLen)!
        let partBB = ByteBuffer(partBBView)
        var idx = 0 // within the part
        let payload = AWSPayload.stream(size: partBB.readableBytes) { eventLoop in
            let remainingInPart = partBB.readableBytes - idx
            let len = min(remainingInPart, chunkSize)
            let chunk = partBB.viewBytes(at: idx, length: len)!
            print("Returning chunk at \(idx), len=\(len) [part \(thisPartIdx)]")
            idx += chunkSize
            return eventLoop.makeSucceededFuture(.byteBuffer(ByteBuffer(chunk)))
        }
        print("Part idx \(partIdx), start=\(partStart), len=\(partLen)")
        partIdx += 1
        return eventLoop.makeSucceededFuture(payload)
    }

    do {
        try fut.wait()
    } catch {
        print("Unexpected error \(error.localizedDescription)")
    }

    try! awsClient.syncShutdown()
}

Like the first example, the error is :

Assertion failed: file NIO/ByteBuffer-core.swift, line 357
2020-11-09 15:53:50.371456-0500 CmdLineTool[74271:2496581] Assertion failed: file NIO/ByteBuffer-core.swift, line 357

Ok, you've found an issue with Swift NIO there when ByteBuffers get too large, but this is also an issue with Soto where it isn't freeing the memory for previously uploaded parts of the request. I have submitted another fix which clears out the already read parts of the byte buffer.
As an aside you could write your AWSPayload.stream a lot simpler
    var bb = ByteBuffer(data: data)
    let payload = AWSPayload.stream(size: bb.readableBytes) { eventLoop in
        print("Sending chunk at \(bb.readerIndex)")
        let len = min(chunkSize, bb.readableBytes)
        let chunk = bb.readSlice(length: len)!
        return eventLoop.makeSucceededFuture(.byteBuffer(chunk))
    }

I'm sorry you are finding so many issues.

No problem, it's great that you are fixing them so quickly. And thanks for that tip on the ByteBuffer API.

Can I ask an unrelated question? If Soto V5 only supported Catalina or later would that be an issue for you?

I’d be fine with that.


media_player.join doesn't get entity_id as target

If you try to join media players to a group, it seems like the target-value doesn't get filled. when using the developer tools, the following works:
service: media_player.join
data:
  group_members:
    - media_player.2
    - media_player.3
    - media_player.4
target:
  entity_id: media_player.1

when trying it with the stream deck like this, nothing happens:
    service: media_player.join
    service_data:
      group_members:
        - media_player.2
        - media_player.3
        - media_player.4
    icon_mdi: speaker-wireless

Please check out #16

Thanks for reporting this!

Maybe I'm overseeing something right now, but I can't get it to work..heres what I tried, I copied the names from the home assistant developer tools, calling the service from there works.
pages:
  - name: Main
    buttons:
      - entity_id: media_player.kuche
        service: media_player.join
        service_data:
          group_members:
            - media_player.badezimmer
            - media_player.living_room
            - media_player.schlafzimmer
        icon_mdi: speaker-wireless

      - entity_id: media_player.kuche
        service: media_player.join
        service_data:
          group_members:
            - media_player.badezimmer
            - media_player.living_room
            - media_player.schlafzimmer
          target:
            entity_id: media_player.kuche
        icon_mdi: speaker-wireless

This is what I used in the service call in home assistant:
service: media_player.join
data:
  group_members:
    - media_player.badezimmer
    - media_player.living_room
    - media_player.schlafzimmer
target:
  entity_id: media_player.kuche

Try

      - entity_id: media_player.kuche
        service: media_player.join
        service_data:
          group_members:
            - media_player.badezimmer
            - media_player.living_room
            - media_player.schlafzimmer
        target:
          entity_id: media_player.kuche
        icon_mdi: speaker-wireless

I tried, resulting in „pages -> 0 -> buttons -> 0 -> target extra fields not permitted“..which is wierd, because I see that you added target as a valid option in the README. I have the feeling docker is not pulling properly, I‘ll move the setup to systemd on a Pi W later today and will retry it there.

From: Bas Nijholt @.>
Sent: Friday, March 31, 2023 11:43:04 AM
To: basnijholt/home-assistant-streamdeck-yaml @.>
Cc: Max Geilert @.>; Author @.>
Subject: Re: [basnijholt/home-assistant-streamdeck-yaml] media_player.join doesn't get entity_id as target (Issue #13)
Try
  - entity_id: media_player.kuche
    service: media_player.join
    service_data:
      group_members:
        - media_player.badezimmer
        - media_player.living_room
        - media_player.schlafzimmer
    target:
      entity_id: media_player.kuche
    icon_mdi: speaker-wireless

—
Reply to this email directly, view it on GitHubhttps://github.com/basnijholt/home-assistant-streamdeck-yaml/issues/13#issuecomment-1491642364, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGMBKAWUEXLOXGQ7CNTRIZTW62RKRANCNFSM6AAAAAAWJXAXUE.
You are receiving this because you authored the thread.Message ID: @.***>

Did you manage to get it to work? :smi


Can you provide training script?

Hi,
I am interested in this work and want to dive in deeper.
Can you provide training code for the results?
Also, how is eresfd_16 different from eresfd?
Thank you for the work.

In the demo section you write: python3 demo.py --model ./weights/eresfd_16.pth yet in the weights folder there are 5 different models:

Could you share the difference between them?


Adding acoustic sensor

Added code for hcsr04 comparable to ds18b20, operates off battery and writes out distance in cm to LCD on button push. Similarly it can be run/print out in beagleterm but requires the user to define the pin names for trig and echo if not running main.py.
I also added/updated the readme and put the fritzing diagram right on the page. I think it may be helpful to have them here in the readmes as well as on the website.

I'm merging myself, I want to have this all included as a demonstration for how other folks can add to the git using the fork > branch > pull request system (my preferred guide: https://www.dataschool.io/how-to-contribute-on-github/)


UPnPService now broadcasts an event when it creates a portmap

Also adds the boilerplate necessary to launch the UPnP component by
itself, as well as a helper script that listens for NewUPnPMapping
events and prints them to stdout.
We have no tests for UPnPService as that would probably require mocking
a ton of stuff, so there's no straightforward way to test that it emits
the events either, but at least now we can launch the component by
itself and there's a script to print the events it emits.

@cburgdorf I've pushed another commit with the change you suggested plus the removal of some stuff that was no longer needed


source{d} talks page must be containarized

And served through Caddy so that it can be deployed via CD

Let's do something similar to what we have in landing and blog that both have static content.


[3.x] Gltf2 Importer now takes '-loop' argument in animation names, but removes it from the final animation name

When importing animations from blender, i needed to add loop to the animation name to detect the animation, but that affected my naming convention, the argument  -loop will do the same with the advantage of also being removed (previous functionality is mantained)

There's a general agreement to have this kind of feature, but also a general agreement that this is not the way to go. Hence, i am removing it


Add OpenData from API Entreprise for agent

[x] Add a new scope opendata
[x] Add EORI client & model
[x] Add carte professionnelle des travaux publics
[x] Add Qualibat
[x] Add Qualifelec
[x] Add Opqibi
[x] Date de naissance

Todo :

Fix E2E test
Add E2E test to check that standard users don't get to see protected data
Add link & label from résumé to certification for agent

I like the idea of IUnauthorized but I dont think it is working :

you end up with a lot more session being pass as arguments
you still need to handle IUnauthorized in view as
you will still need to have a way for the view to prevent API call based on rights. See conformite for instance. Otherwise it will lead to many unnecessary calls
As API calls from API Entreprise tend to be very slow (appart from the test env) we will need to use async a lot

I like the see more, but we need something much more obvious visually. I missed it several time in local trying to force trigger it, before eventually I realised I had it in front of me, I just did not see it.
Maybe github can be an inspiration on this, I find that their collapsed comment component is quite explicit

every call should be made async as API Entreprise tend to be much slower than sirene and the whole point of the /app router migration was to allow more async call from /entreprise page

This is only the case for agent. If you believe it's too much of trade off, we could use async server component. This would enable us to load the page first and then render, without having to move calls to an API route first.

require to share the session to the model, which I tried to avoid

I think it is the point. The view shouldn't have to know which API call to make depending on authorization level. This is a specific domain logic that should be inside the model. If you think sharing the session with the model is not a good pattern (I do agree, but I did it for the sake of simplicity :p), we can refactor, and only share the User model, or just the scopes.

see more is a really good idea, but this implementation is not obvious enough (I add a really hard time finding it, knowing it was there)

We cannot do without because otherwise, the carteProfessionnelle document would be pushed down very far on the page, especially when there is a lot of actes (like it does with large companies). We can however fix it's visibility and affordability.

we should move them into a dedicated section, not replace the rne section, even if it creates duplicates as RNE and RCS are not the same and dont hold the same meaning.

From a data perspective, I agree, but does-it from a user-centric standpoint ? I'm only asking, to understand better. In which case the RCS would differ from the RNE ?

we need a way to display badges on /entreprise page and/or /etablissement page (if they make sense at siret level)

Yes !


CocoaPods could not find compatible versions for pod "GoogleMLKit/BarcodeScanning"

I cannot build flutter ios app, because I still have an error:
[!] CocoaPods could not find compatible versions for pod "GoogleMLKit/BarcodeScanning":
  In Podfile:
    google_mlkit_barcode_scanning (from `.symlinks/plugins/google_mlkit_barcode_scanning/ios`) was resolved to 0.4.0, which depends on
      GoogleMLKit/BarcodeScanning (~> 3.1.0)

    mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`) was resolved to 0.0.1, which depends on
      GoogleMLKit/BarcodeScanning (~> 2.6.0)

Flutter doctor -v:
[✓] Flutter (Channel stable, 3.3.1, on macOS 12.5.1 21G83 darwin-arm, locale pl-PL)
    • Flutter version 3.3.1 on channel stable at /Users/mac1/fvm/versions/3.3.1
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4f9d92fbbd (2 dni temu), 2022-09-06 17:54:53 -0700
    • Engine revision 3efdf03e73
    • Dart version 2.18.0
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0-rc1)
    • Android SDK at /Users/mac1/Library/Android/sdk
    • Platform android-33, build-tools 32.0.0-rc1
    • ANDROID_SDK_ROOT = /Users/mac1/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13F100
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2022.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 70.0.5
    • Dart plugin version 222.3739.24

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

I had a similar issue and I believe it relates to the fact that in the yaml file in the root directory each of the individual mlkit dependencies are being defined using a local path. Those local directories seem to have mlkit plugins with inconsistent references. I solved this by commenting out the path line in the yaml file -> running pub get -> going into the ios folder -> deleting my podfile.lock -> going into the terminal and running all the commands in this link: https://stackoverflow.com/questions/72972280/cocoapods-could-not-find-compatible-versions-for-pod-firebasecore-error-on-r
Having done the above i then rerun the example project on my iphone and it worked :) I'm not sure if every step above is necessary, but i hope it helps.

The issue what that both google_mlkit_barcode_scanning and mobile_scanner were using different versions of GoogleMLKit/BarcodeScanning. But upgrade to the lates versions of both plugin, now both are using the same:
https://github.com/flutter-ml/google_ml_kit_flutter/blob/master/packages/google_mlkit_barcode_scanning/ios/google_mlkit_barcode_scanning.podspec
https://github.com/juliansteenbakker/mobile_scanner/blob/master/ios/mobile_scanner.podspec


Add Support form to meshery

Notes for Reviewers
This PR adds support form to meshery when we get any errors .
The files had to be refactored a little bit which i will be doing but prior to that I am getting CORS error when i am making post req to webhook of make.com
It will look like

Signed commits

[ ] Yes, I signed my commits.

This the cors error:


Keras/TF update

Black formatted all the files I touched, so ignore that. All that's been changed are imports and version pins.


Getting "TypeError: db.client.setTracker is not a function"

Hi, I have created a sample unit test using knex 2.4.2 and knex-mock-client 2.0.0 however upon running the unit test, I'm getting the type error:

Here's my sample unit test:

I haven't added a test yet because I'm trying to isolate the issue and this is my database/index:

I have also tried to make it a named export just like in the readme file but still getting the same error. Any thoughts?

Hi @kevbahia, can you share you sample repo?

Unfortunately, I wasn't able to share this exact repo because it's a client code. What I did instead is I tried to replicate this on a sample app but then I'm getting a different error. here is the link

From this repo looks like it is an issue with setup of jest mocks... (esm modules)
I'm not using esm, so I can't really help you.
You can check the db.client field, it should be MockClient

Following this blog post there are 2 things that should be changed,

using jest.unstable_mockModule instead of jest.mock
importing knex lib with import()
importing the mocked module after the mocking (because jest not hoisting the mock as it does with cjs)

import { jest } from "@jest/globals";
import { createTracker, MockClient } from "knex-mock-client";

jest.unstable_mockModule("../src/database/index.js", async () => {
  const knex = await import("knex");
  return {
    db: knex.default({ client: MockClient }),
  };
});

describe("sample service", () => {
  let tracker;

  beforeAll(async () => {
    const { db } = await import("../src/database/index.js");
    tracker = createTracker(db);
  });

  it("should pass with valid data", async () => {

  });
});

This snippet works without errors.

Hi @felixmosh, I tried the snippet you have mentioned and it works! I can proceed now with my unit tests using knex-mock-client. Thanks! 😄


[Proposal] add updateSource method

Current updateCard method creates a new card and leaves the old one intact. This was discussed in #282, but wasn't solved.
Having the new updateStripeCustomer method from #634, I would like to suggest creating an updateSource method or changing the way updateCard method works.
Stripe encourages using this way of updating a card:
https://stripe.com/docs/api/customers/update#update_customer-source
https://stripe.com/docs/recipes/updating-customer-cards#using-the-token-to-update-the-customers-card
Following the contribution guidelines, I created this issue before creating a pull request, however the implementation of the updateSource method is ready and you can check it here. I'm waiting for your review before I can make a pull request.

I'm going to have to say no because it's basically a one-liner which you can add to your own project. The current Stripe docs are also all disregarding making use of the current cards api because of the new SCA regulations coming up in September. We'll need to review all of this for v10 so I'm gonna hold off on this now.

Btw also see: https://github.com/laravel/cashier/issues/649


Add waitFor to assertButtonDisabled

In the instance where a button becomes enabled/disabled as part of DOM manipulation via JS, if the function to change disable state is slow due to performance the wait will prevent it from immediately falling.

Paging @RedEnchilada to review the back-end work in this pull request!


Issue #72 persists

Please reopen issue #72. Still getting errors like "IOError: [Errno 21] Is a directory: " when trying to inject xib files

+1


Fix issue 204 (xspec.sh fails to generate code coverage report when stderr contains other outputs)

This pull request derives from #342. So needs to be handled after that.

Fixes #204.
How to test this pull request

Check out<PHONE_NUMBER>d3bd5356489ceb4ccdf1f971a65ba5 which reproduces the problem.
Go to [XSpec]/test.
Do export SAXON_JAR=/path/to/saxon9ee.jar. (Saxon-PE should be fine too, but I haven't tested.)
Run ./run-bats.sh --tap.
==> Test 14 should fail.
Check out 524d5046b27a9099008db7cc24ffea09d8c269c5 which fixes the problem in the same way as xspec.bat.
Run ./run-bats.sh --tap.
==> Test 14 should pass.

@cirulls
Merged this bug fix.
Before merging this, I ran xspec.sh -c tutorial/coverage/demo.xspec on Saxon-EE <IP_ADDRESS> and verified that it generated the same coverage report as xspec.bat.


v0.20.0

Fixed

Recording generation for Observable streams

Added

New piece: Expand/Collapse

Resolves #114.
Resolves #109.

Verified on staging.


How does TuioListener move or click the mouse？

I saw：
    class MyListener(TuioListener):         def add_tuio_cursor(self, cursor):             print("detect a new Cursor")             assert type(2) == type(cursor.session_id)   # look if sessionid is a number         def remove_tuio_cursor(self, cursor):             print("Cursor disapered")             assert type(2) == type(cursor.session_id)   # look if sessionid is a number         def update_tuio_cursor(self, cursor):             print("recognize a Cursor")             assert type(2) == type(cursor.session_id)   # look if sessionid is a number
But I don't know how to trigger the cursor
Look forward to your reply Thank you

I saw：
    class MyListener(TuioListener):
        def add_tuio_cursor(self, cursor):
            print("detect a new Cursor")
            assert type(2) == type(cursor.session_id)   # look if sessionid is a number
        def remove_tuio_cursor(self, cursor):
            print("Cursor disapered")
            assert type(2) == type(cursor.session_id)   # look if sessionid is a number
        def update_tuio_cursor(self, cursor):
            print("recognize a Cursor")
            assert type(2) == type(cursor.session_id)   # look if sessionid is a number

But I don't know how to trigger the cursor
Look forward to your reply Thank you

If I want to implement it, do I need to move the mouse myself?  I'm not very clear about tuio's ability

It is quite a while ago but I think you have to hold the click and drag the mouse in the simulator.

这是很久以前的事了，但我认为您必须在模拟器中按住单击并拖动鼠标。

Thanks for your reply，This means that tuio does not have this function. I need to move or click by myself, right?

Tuio is a protocol, which can be used to transfer touch information.
So yea you have to touch a screen . To simulate this, there is this simulator you and use with the mouse cursor. To have a better user experience you can use an tuio app , I know in the past there were some touchscreen tester apps supporting tuio protocol.

Tuio is a protocol, which can be used to transfer touch information. So yea you have to touch a screen . To simulate this, there is this simulator you and use with the mouse cursor. To have a better user experience you can use an tuio app , I know in the past there were some touchscreen tester apps supporting tuio protocol.

I know, but I have encountered some TuioServer implemented by C #, which can achieve touch triggering without requiring a touch screen when sending cursors.
I know


In Library listing, Edit button

Right now there is just the Open button, so there is space to also add an Edit button so you can go direct to editing.

You mean for individual models, to go straight to their edit page? Makes sense!

Yes


randomUUID is not a function

I'm using the local driver, and when I do the put method, I get the following error.

Have you looked into it?

Yes, it was added in a newer version of node, I added the warning and updated my node version


8-bit MFLUX

Hello,
It is not clear to me where the 8-bit MFLUX can be downloaded from. It is selectable in your custom nodes, but I cannot find an option to download.
Can you help?
Thanks

Hello, thank you for your feedback. This is the first issue I’ve received, thank you.
The MfluxModelsDownloader node currently only includes downloading "flux.1-schnell-mflux-4bit" and "flux.1-dev-mflux-4bit." If you want to use the 8-bit version, you can try the custom model node MfluxCustomModels. However, the prerequisite for using it is that you already have the full 33GB Black Forest native model in your .cache. You can quantize and save your own model by specifying the model (Schnell or Dev) along with the quantize parameter set to 8.
The custom_identifier field can be filled in arbitrarily or even left blank. Once you’ve saved it, you can find it in models/Mflux.
If you don’t have the full Black Forest model in your .cache, you might want to try:
https://huggingface.co/AITRADER/MFLUX.1-schnell-8-bit
https://huggingface.co/AITRADER/MFLUX.1-dev-8-bit
I just found them on Hugging Face, but I haven't tested them. If you can try them and confirm they work properly, I will add them to the list in the MfluxModelsDownloader node soon.

Thank you for your quick response! I am using ComfyUI from within Pinokio, as it provides specific MPS advantages without too much fine-tuning. I was able to download the 8-bit version using the original Mflux into a folder on my machine. However, here is the challenge:

The 8-bit version needs to go into /models/Mflux. But what should the folder name be named in order for the Mflux nodes to recognise it?
Even in that case, the error about the missing login/token will still pop up. You wrote "the prerequisite for using it is that you already have the full 33GB Black Forest native model in your .cache". Can you point me to the exact location in the ComfyUI structure where the original native model should be stored? I already have it in my unit folder and it works fine. Many thanks!

I may not be able to fully answer the three questions you mentioned, but I’ll do my best:
1.I'm not very familiar with the path mechanism of ComfyUI in Pinokio, as I haven’t tried Pinokio yet. So far, my environment has always been the native COMFYUI.
I’m not sure if the 8-bit model you downloaded is this one:
https://huggingface.co/AITRADER/MFLUX.1-dev-8-bit/tree/main
If so, you’ll need to manually create an "MFLUX.1-dev-8-bit" folder in models/Mflux. Download all files from the above address into models/Mflux/MFLUX.1-dev-8-bit, and then you can directly use the “Mflux Models Loader” node to load it. You should see "MFLUX.1-dev-8-bit" available in the list for selection.
Here’s the file structure I found on the Mflux website:
MFLUX.1-dev-8-bit
├── text_encoder
│   └── model.safetensors
├── text_encoder_2
│   ├── model-00001-of-00002.safetensors
│   └── model-00002-of-00002.safetensors
├── tokenizer
│   ├── merges.txt
│   ├── special_tokens_map.json
│   ├── tokenizer_config.json
│   └── vocab.json
├── tokenizer_2
│   ├── special_tokens_map.json
│   ├── spiece.model
│   ├── tokenizer.json
│   └── tokenizer_config.json
├── transformer
│   ├── diffusion_pytorch_model-00001-of-00003.safetensors
│   ├── diffusion_pytorch_model-00002-of-00003.safetensors
│   └── diffusion_pytorch_model-00003-of-00003.safetensors
└── vae
└── diffusion_pytorch_model.safetensors
If manual downloading is confusing, I suggest using the Mflux Models Downloader node to automatically download the 4BIT version first. Then open models/Mflux and review the 4BIT version’s structure; I think this will give you a clear idea.
2.As for .cache, this is managed by Hugging Face and doesn’t depend on ComfyUI. If you follow the simplest workflow—Quick MFlux Generation node + save image—the full Black Forest native model will be automatically downloaded to your .cache. If you haven't modified the HF_HOME variable, it will default to "YourUsername/.cache".
3.Currently, using LoRA with quantized models results in errors unless you apply LoRA on the full model using the Mflux Custom Models node for quantization. For details, please refer to my README, where I’ve included a brief guide.

Hello,Reading this I’d like to share how I’ve got mine to work. I guess the easiest way was to use MFLUX and quantise the dev model from huggingface to my desktop simply using this command:mflux-save \    --path "/Users/you/Desktop/dev_8bit" \    --model dev \    --quantize 8This, will download the model, quantise it to 8bit if you choose, and create the correct folder architecture on your desktop or where you want it. Might have to run the line to allow access to hugging face too. Then you can just move it to the correct location and also you can remove the full model from .cache to save some space if desired. Samuel Gaudreau+61 474 535 956Eleebana, AustraliaOn 26 Oct 2024, at 5:08 am, raysers @.***> wrote:
I may not be able to fully answer the three questions you mentioned, but I’ll do my best:
1.I'm not very familiar with the path mechanism of ComfyUI in Pinokio, as I haven’t tried Pinokio yet. So far, my environment has always been the native COMFYUI.
I’m not sure if the 8-bit model you downloaded is this one:
https://huggingface.co/AITRADER/MFLUX.1-dev-8-bit/tree/main
If so, you’ll need to manually create an "MFLUX.1-dev-8-bit" folder in models/Mflux. Download all files from the above address into models/Mflux/MFLUX.1-dev-8-bit, and then you can directly use the “Mflux Models Loader” node to load it. You should see "MFLUX.1-dev-8-bit" available in the list for selection.
Here’s the file structure I found on the Mflux website:
MFLUX.1-dev-8-bit
├── text_encoder
│   └── model.safetensors
├── text_encoder_2
│   ├── model-00001-of-00002.safetensors
│   └── model-00002-of-00002.safetensors
├── tokenizer
│   ├── merges.txt
│   ├── special_tokens_map.json
│   ├── tokenizer_config.json
│   └── vocab.json
├── tokenizer_2
│   ├── special_tokens_map.json
│   ├── spiece.model
│   ├── tokenizer.json
│   └── tokenizer_config.json
├── transformer
│   ├── diffusion_pytorch_model-00001-of-00003.safetensors
│   ├── diffusion_pytorch_model-00002-of-00003.safetensors
│   └── diffusion_pytorch_model-00003-of-00003.safetensors
└── vae
└── diffusion_pytorch_model.safetensors
If manual downloading is confusing, I suggest using the Mflux Models Downloader node to automatically download the 4BIT version first. Then open models/Mflux and review the 4BIT version’s structure; I think this will give you a clear idea.
2.As for .cache, this is managed by Hugging Face and doesn’t depend on ComfyUI. If you follow the simplest workflow—Quick MFlux Generation node + save image—the full Black Forest native model will be automatically downloaded to your .cache. If you haven't modified the HF_HOME variable, it will default to "YourUsername/.cache".
3.Currently, using LoRA with quantized models results in errors unless you apply LoRA on the full model using the Mflux Custom Models node for quantization. For details, please refer to my README, where I’ve included a brief guide.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

Hello, @sanctimon, I've added the 8-bit version to the downloader, so now you can directly download it using the MfluxModelsDownloader node. I hope this helps!
I also reviewed your previous reply carefully. You mentioned that you could place models in UNET and use them successfully, which suggests that those models are likely single safetensors files. This is different from the MFLUX model format, which is similar to diffusers and organized more like a folder structure.
I made a mistake earlier, assuming some users already had the complete MFLUX-compatible models in ComfyUI and advised them to move them to models/Mflux to avoid .cache downloads. However, based on the common usage of FLUX models, even if users had a full model setup previously, it would likely be a single safetensors file rather than the folder format that MFLUX requires. So, moving it to models/Mflux would likely not work as intended. I’ve removed this potentially misleading information from the README.
Good luck!

@raysers how change model path, my model in other disk drives. how move it to them

你在上海吗？我斗胆使用中文来回答。
这里的模型路径是代码中预设的，暂时无法从其他路径加载。
另外能否了解一下你以前的模型是单个的safetensor或者GGUF文件吗？如果是那种模型，那在我这个插件是无法使用的。
MFLUX使用的模型类似于diffusers模型，一般是整个文件目录，不是单独的safetensor

@raysers how change model path, my model in other disk drives. how move it to them

你在上海吗？我斗胆使用中文来回答。
这里的模型路径是代码中预设的，暂时无法从其他路径加载。
另外能否了解一下你以前的模型是单个的safetensor或者GGUF文件吗？如果是那种模型，那在我这个插件是无法使用的。
MFLUX使用的模型类似于diffusers模型，一般是整个文件目录，不是单独的safetenso

@raysers how change model path, my model in other disk drives. how move it to them

你在上海吗？我斗胆使用中文来回答。
这里的模型路径是代码中预设的，暂时无法从其他路径加载。
另外能否了解一下你以前的模型是单个的safetensor或者GGUF文件吗？如果是那种模型，那在我这个插件是无法使用的。
MFLUX使用的模型类似于diffusers模型，一般是整个文件目录，不是单独的safetenso

我有safetensor文件，以及通过Mflux下载的文件目录，或者可以使用扩展路径来调用它吗？mac的容量太小了，我把模型文件移动到移动硬盘里。

@tolozine 没问题，我可以加入和官方一样的手动指定路径当做另外的选择。其实我个人也一直使用移动硬盘，甚至连ComfyUI都是装在移动硬盘上的，并且我的HF_HOME变量也调整指定到了移动硬盘里。因此我没考虑过空间不足的问题。
或者我测试一下如何让extra model能够生效，如果解决了那直接可以修改comfyui的文件来映射到models/MFlux


Tile: isActionable does not scale svg

When Tile has isActionable set, it does not scale svg type (iTwinUI v1.37.1)

in #1110, we have improved the tile hover effect in a few different ways. the initial implementation was trying to scale the svgs but it was resulting in some unpleasant visuals, so the new effect will now rotate the svg by a few degrees and translate the whole tile by a few pixels.
https://user-images.githubusercontent.com/9084735/222790186-e900013f-78a1-49c8-bf81-468d424e7c85.mov


Use installer outputs & Fix (de)activate scripts

Close #2.
This PR does 3 things:

Use Windows installer and install (not extract!) to $PREFIX\Library
Fix (de)activate scripts to not print debug messages in user environments
Erase the pre-installed MPI from Conda-Forge's VM image so that downstream packages can test MPI against msmpi

Checklist

[x] Used a personal fork of the feedstock to propose changes
[x] Bumped the build number (if the version is unchanged)
[ ] Reset the build number to 0 (if the version changed)
[x] Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
[x] Ensured the license file is being packaged.

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@conda-forge-admin, please rerender

Hmmm, ok, so if we remove the old MPI runtime and then install, -installroot will work...Interesting.

Hmmm, ok, so if we remove the old MPI runtime and then install, -installroot will work...Interesting.

I should have noticed this in https://github.com/conda-forge/msmpi-feedstock/pull/7/commits/ddccb520f0683468179129660a51ea8f3b091d55!!!
https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=308809&view=results

PR description updated. Note that using the installer properly should fix the 32 vs 64 bit issue (default is 32 bit if extracting from the exe directly)...

Verified working in downstream packages:

https://github.com/conda-forge/mpi4py-feedstock/pull/43
pybind11-mpi4py (https://github.com/mpi4py/mpi4py/issues/19#issuecomment-829398857)


No list of themes to choose from

I was unable to find a list containing all available themes for a Select2 Box in the . The only way to know which themes you can choose from is to go to select2/src/scss/theme/ and look at the folder names. (Even if there is another way which i missed there definetely should be a list of themes under the )
I will add a PR that fixes this

I must have accidentally closed this, nvm. The PR related to this Issue is #5944

So this is challenging because Select2 comes with the two themes you have noted, but we also support third party themes, some of which are listed in the README: https://github.com/select2/select2#integrations


when you add an assignee to a task, then edit the description and save, the assignee changes to fake

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Sign into staging.new.expensify.com
Click '+' > assign a task
Assign it to a user
Click Confirm Task
Click the description for the user
Add more text, then save
See that the assignee has changed to fake

Expected result:
the assignee remains the same after changing the description
Actual result:
the assignee changes to fake
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:

Which of our officially supported platforms is this issue occurring on?

[x] Android / native
[x] Android / Chrome
[x] iOS / native
[x] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

Version Number: <IP_ADDRESS>
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/43996225/7b8e78f2-27dd-4be9-bdbb-9a38f38290ca
https://github.com/Expensify/App/assets/43996225/0b7364b8-09a1-421b-a511-18c99fef4435
Expensify/Expensify Issue URL:
Issue reported by: @muttmuure
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684349723299479
View all open jobs on GitHub
cc @thienlnam

I can replicate this but I'm not sure if it needs to be internal... assigning eng.

This is done - back end changes are deployed

Awesome, I closed the Upwork job as we didn't use any external contributors for the fix. Let me know if I'm missing someone!


Google Gemini 1.5 pro via API access

Description of the feature request:
I want to use latest version of Google Gemini-1.5-pro via API or SDK that can be integrated to our projects.
What problem are you trying to solve with this feature?
Solving the whole codebase upload media and more with 1 Million tokens limit to achieve maximum efficiency from this model.
Any other information you'd like to share?
Here is error i got
Error generating response: 404 models/gemini-1.5-pro-latest is not found for API version v1beta, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.

Here is the code:
import os
import google.generativeai as genai
from dotenv import load_dotenv

def init_api_keys():
    try:
        load_dotenv()
        api_key = os.getenv("GEMINI_API_KEY")
        genai.configure(api_key=api_key)
    except Exception as exception:
        print("Error in initializing API keys:", exception)
        raise

def generate_response(prompt:str):

  # Set up the model
  generation_config = {
    "temperature": 0.1,
    "top_p": 1,
    "top_k": 1,
    "max_output_tokens": 2048,
  }

  model = genai.GenerativeModel(model_name="gemini-1.5-pro-latest",generation_config=generation_config)

  prompt_parts = [prompt]

  try:
    response = model.generate_content(prompt_parts)
    print(response.text)
  except Exception as exception:
    print("Error generating response:", exception)

if __name__ == "__main__":
    init_api_keys()
    prompt = input("> ")
    generate_response(prompt)

First you need to be white listed for Google Gemini-1.5-pro
If you are then you should know that Google Gemini-1.5-pro doesnt work though the gemini api which is what this library is for.
If you do have access and really want to try Google Gemini-1.5-pro try going though vertex and use the vertex library i hear it works there.

First you need to be white listed for Google Gemini-1.5-pro If you are then you should know that Google Gemini-1.5-pro doesnt work though the gemini api which is what this library is for.
If you do have access and really want to try Google Gemini-1.5-pro try going though vertex and use the vertex library i hear it works there.

But still in vertex-ai Gemini 1.5 pro is not available via API?

@haseeb-heaven That's a completely different white list.  I have only heard that it exits i don't know anyone that got access to that yet.  Its not the same as the white list to access it in Google Ai Studio.
Im not even sure how to get on that whitelist.

I can see version 1.5 in ai studio, I can selected this version. And when I examine the network panel after the prompt sending and receive response, requests are sent to google services with the 1.5 version parameter. However, when I try to access the 1.5 version via the API, I get 404, which is the error our friend received.
I think even though we are whitelisted, this does not mean that we can access the API.
Maalesef Google kaynaklarında bununla ilgili yeterince döküman yok.

@haseeb-heaven That's a completely different white list. I have only heard that it exits i don't know anyone that got access to that yet. Its not the same as the white list to access it in Google Ai Studio.
Im not even sure how to get on the Vertex ai whitelist for gemini pro 1.5
You need to test via ai studio.

Okay i will test via Vertex AI API but i prefer Google AI Studio API because it need only single API key for authorization.

@SeanTolstoyevski I think you need to reread what you are white Listed for
There is NO api currently for Gemini pro 1.5 the white list only gives you access to test in Google ai studio they haven't implemented an API for it they just gave us ai studio testing

I've got whitelisted on AI Studio too. Shame it's blocked in Denmark (or whole EU in that regard). If someone reverse-engineers, it feels like GPT-5 for some tasks and I am excited to integrate.
@LindaLawton do you have any idea where to find application/form for use in VertexAI?

I have access to 1.5 in AIStudio, but there is no API access in version 0.4.1. Does anyone know when they plan to add it? The following packages are currently available:
models/chat-bison-001
models/text-bison-001
models/embedding-gecko-001
models/gemini-1.0-pro
models/gemini-1.0-pro-001
models/gemini-1.0-pro-latest
models/gemini-1.0-pro-vision-latest
models/gemini-pro
models/gemini-pro-vision
models/embedding-001
models/aqa

I got access today it's comming.

Same here

@LindaLawton @Arkm20 , please how did you get access. i need it

Im a google developer expert for ai/ml some on at google sent me a hangout message and asked for the project i wanted white listed.    If GDE's are getting access its only a matter of time before the others white listed for 1.5 on ai studio get access hang in there.
Heads up the model name is gemini-1.5-pro-latest when you get access.

Thank you @LindaLawton

@LindaLawton are you leveraging pro-1.5 in the python SDK? or in the console?

Im using this library to work with Gemini pro 1.5  the code is the same its just a different model.  You use gemini-1.5-pro-latest instead of gemini-pro and your good to go.
you need to be whitelisted.

Im using this library to work with Gemini pro 1.5 the code is the same its just a different model. You use gemini-1.5-pro-latest instead of gemini-pro and your good to go.
you need to be whitelisted.

But how to get whitelisted please explain that in details thanks

If you are white Listed for ai studio you will get in eventually
If you're not you need to apply to be white Listed
In both cases you just wait

If you are white Listed for ai studio you will get in eventually
If you're not you need to apply to be white Listed
In both cases you just wait

I tried to list all the models available and i got this list.
def list_all_models():
    try:
        models = genai.list_models()
        for model in models:
            print(f"Name: {model.name}, Display Name: {model.display_name}")
    except Exception as exception:
        print("Error listing models:", exception)

Output:
Name: models/chat-bison-001, Display Name: PaLM 2 Chat (Legacy)
Name: models/text-bison-001, Display Name: PaLM 2 (Legacy)
Name: models/embedding-gecko-001, Display Name: Embedding Gecko
Name: models/gemini-1.0-pro, Display Name: Gemini 1.0 Pro
Name: models/gemini-1.0-pro-001, Display Name: Gemini 1.0 Pro 001 (Tuning)
Name: models/gemini-1.0-pro-latest, Display Name: Gemini 1.0 Pro Latest
Name: models/gemini-1.0-pro-vision-latest, Display Name: Gemini 1.0 Pro Vision
Name: models/gemini-pro, Display Name: Gemini 1.0 Pro
Name: models/gemini-pro-vision, Display Name: Gemini 1.0 Pro Vision
Name: models/embedding-001, Display Name: Embedding 001
Name: models/aqa, Display Name: Model that performs Attributed Question Answering.

My Google generativeai version:
pip show google-generativeai
Name: google-generativeai
Version: 0.4.1

See the gemini-1.5-pro-latest isn't even listed.

It will be when they give you access I had to have my project whitelist

I too get the same result (404) and the same (non-1.5) list of models as everyone else except @LindaLawton, using google-generativeai v 0.4.1. I have AI Studio 1.5 access via both a personal account and a Google Workspace account. I generated API keys from both those accounts but neither of them yields gemini-1.5-pro-latest. Google, please show us the love 🙏

I can not you must wait to be white Listed to the API it's comming they are releasing it slowly

It looks like they've removed the whitelist and opened up access to 1.5 in AI Studio. Hopefully that means it will be accessible in the API soon.

It looks like they've removed the whitelist and opened up access to 1.5 in AI Studio. Hopefully that means it will be accessible in the API soon.

Yes i saw Twitter post about this hopefully we will get the API access soon.

https://twitter.com/JeffDean/status/1770653917543870571

Any idea if the pricing for Gemini Pro 1.5 will be the same as 1.0?
https://ai.google.dev/pricing

Gemini 1.5 pro api is avaliable now.

Gemini 1.5 pro api is avaliable now.

sry friend, how do you get it?
I checked my google dev studio, its "code" button still unavailable. and it's not listed in model list api either.

Gemini 1.5 pro api is avaliable now.

sry friend, how do you get it? I checked my google dev studio, its "code" button still unavailable. and it's not listed in model list api either.

i got an email....
[Preview] Gemini API Access External
Hello,
We're thrilled to announce that we’ve started rolling out access to the Gemini 1.5 Pro API! This lets you bring the power of Gemini 1.5 Pro beyond Google AI Studio.

so i got it.

Gemini 1.5 pro api is avaliable now.

sry friend, how do you get it? I checked my google dev studio, its "code" button still unavailable. and it's not listed in model list api either.

i got an email....
[Preview] Gemini API Access External
Hello,
We're thrilled to announce that we’ve started rolling out access to the Gemini 1.5 Pro API! This lets you bring the power of Gemini 1.5 Pro beyond Google AI Studio.

so i got it.

ok. thx. maybe what I can do is just waiting.

so i got it.
Did you need to ask for it?  Or are they just handing it out to everyone on the gemini 1.5 early access list?

I am also curious how to ask or apply to get access to Gemini 1.5 Pro API. I have already sent the application to get early access to it weeks ago, but they never responded. Anyone who knows please help!

i got access through mail but getting error in trying to access

i got access through mail but getting error in trying to access

did u tried with created a new key?

i got access through mail but getting error in trying to access

did u tried with created a new key?

yes I tried with new key in google ai studio also and tried with private key of project also , same error

i got access through mail but getting error in trying to access

So how did you get access to begin with ? Is it because you already had access to Gemini 1.5 Pro waitlist before they removed the waitlist ? Is it because you have a Google Workspace account ?

Searching through internet I only saw some pages or some people saying Google rolled out Gemini 1.5 Pro API to "some developers", but regarding how is this process decided, like how do they decide who to give access to - no one said anything to clarify. Wtf.

Most of these questions are out of scope for this library I recommend you join [discord channel

gemini-api](https://ai.google.dev/docs/discord)
You can get help there from other developers

Hope this helps
Firstly Google would send you an invite to join. Then fill that form and you have to specify your project id. Make sure you remember the project id!
First email from Google
Hello,
We're thrilled to announce that we've started rolling out access to the Gemini 1.5 Pro API! This lets you bring the power of Gemini 1.5 Pro beyond Google AI Studio.
How to request access:
Submit one Google Cloud Project Number (digits only) using this form.
We'll email you if access is enabled for your project.
Gemini 1.5 Pro:
Fill form
Reply from Google:
Hello,
We're excited to share that you now have access to the Gemini 1.5 Pro API and the File API! Your feedback on this highly-requested preview feature is incredibly valuable. Please share your thoughts and any projects you build!
Instructions:
Go to https://aistudio.google.com and create a new key with the "Project ID" that you filled in the form (I had to create a new key. If you already have a key with that project ID, I assume it would work).
Then run the following command:
curl
-H 'Content-Type: application/json'
-d '{"contents":[{"parts":[{"text":"Write a story about Wikipedia"}]}]}'
-X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent?key=yourkey
The mistake I made was using a key from a different project.

Thanks all for confirming i am yet to receive my API key from Google once i receive i will update this issue.

So it looks like the Gemini 1.5 rates isn't the same... Sad...
Rate limit	2 queries per minute, 1000 queries per day
according to Official Gemini Docs

@goodanthony I still haven't recieved that reply...

The API for Google Gen AI 1.5 is now available.
https://developers.googleblog.com/2024/04/gemini-15-pro-in-public-preview-with-new-features.html?m=1

The API for Google Gen AI 1.5 is now available. https://developers.googleblog.com/2024/04/gemini-15-pro-in-public-preview-with-new-features.html?m=1

Still not working for me... unless I am doing something wrong?

GoogleGenerativeAIError: [404 Not Found] models/gemini-1.5-pro-latest is not found for API version v1, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.

The code that generated the above error works perfectly fine with the model code gemini-pro, but not with gemini-1.5-pro-latest
¯_(ツ)_/¯

@johnomeara1, try creating a new key at  https://aistudio.google.com/ with the "Project ID" that you are calling the API.

Thanks for the tip!
Here's what ended up working for me:
const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }, {
    apiVersion: 'v1beta',
});

The key is using API version v1beta, as that is the only version that supports the gemini-1.5-pro-latest model at this time. Although the above code is for the javascript client library, it can be modified for various languages of google's client for generative AI (python, etc.)

I wish to code for golang. any chance to modifiy that code:
model := client.GenerativeModel("Gemini 1.5 Pro")
there are no curly bracets in golang version

Thanks for the tip!
Here's what ended up working for me:
const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }, {
    apiVersion: 'v1beta',
});

The key is using API version v1beta, as that is the only version that supports the gemini-1.5-pro-latest model at this time. Although the above code is for the javascript client library, it can be modified for various languages of google's client for generative AI (python, etc.)

Thanks, spent ages debugging this before I found your post. Was this communicated anywhere or were we just supposed to figure it out on our own?

It works fine for me just without the {apiversion}

The API for Google Gen AI 1.5 is now available. https://developers.googleblog.com/2024/04/gemini-15-pro-in-public-preview-with-new-features.html?m=1

Still not working for me... unless I am doing something wrong?

GoogleGenerativeAIError: [404 Not Found] models/gemini-1.5-pro-latest is not found for API version v1, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.

The code that generated the above error works perfectly fine with the model code gemini-pro, but not with gemini-1.5-pro-latest
¯_(ツ)_/¯

Create new API again and select the project which has access of Gemini 1.5 pro, it’s working for me i created new API key.

All projects have access now to Gemini 1.5 pro....  It's now on Public access.
But I do find the rates to be very annoying. Only 2 requests per minute...

Here: https://ai.google.dev/models/gemini#:~:text=2 queries per minute%2C 1000 queries per day

Description of the feature request:
I want to use latest version of Google Gemini-1.5-pro via API or SDK that can be integrated to our projects.
What problem are you trying to solve with this feature?
Solving the whole codebase upload media and more with 1 Million tokens limit to achieve maximum efficiency from this model.
Any other information you'd like to share?
Here is error i got
Error generating response: 404 models/gemini-1.5-pro-latest is not found for API version v1beta, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.

Here is the code:
import os
import google.generativeai as genai
from dotenv import load_dotenv

def init_api_keys():
    try:
        load_dotenv()
        api_key = os.getenv("GEMINI_API_KEY")
        genai.configure(api_key=api_key)
    except Exception as exception:
        print("Error in initializing API keys:", exception)
        raise

def generate_response(prompt:str):

  # Set up the model
  generation_config = {
    "temperature": 0.1,
    "top_p": 1,
    "top_k": 1,
    "max_output_tokens": 2048,
  }

  model = genai.GenerativeModel(model_name="gemini-1.5-pro-latest",generation_config=generation_config)

  prompt_parts = [prompt]

  try:
    response = model.generate_content(prompt_parts)
    print(response.text)
  except Exception as exception:
    print("Error generating response:", exception)

if __name__ == "__main__":
    init_api_keys()
    prompt = input("> ")
    generate_response(prompt)

hello,do you know how to use this api to get answers for video input

Description of the feature request:
I want to use latest version of Google Gemini-1.5-pro via API or SDK that can be integrated to our projects.
What problem are you trying to solve with this feature?
Solving the whole codebase upload media and more with 1 Million tokens limit to achieve maximum efficiency from this model.
Any other information you'd like to share?
Here is error i got
Error generating response: 404 models/gemini-1.5-pro-latest is not found for API version v1beta, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.

Here is the code:
import os
import google.generativeai as genai
from dotenv import load_dotenv

def init_api_keys():
    try:
        load_dotenv()
        api_key = os.getenv("GEMINI_API_KEY")
        genai.configure(api_key=api_key)
    except Exception as exception:
        print("Error in initializing API keys:", exception)
        raise

def generate_response(prompt:str):

  # Set up the model
  generation_config = {
    "temperature": 0.1,
    "top_p": 1,
    "top_k": 1,
    "max_output_tokens": 2048,
  }

  model = genai.GenerativeModel(model_name="gemini-1.5-pro-latest",generation_config=generation_config)

  prompt_parts = [prompt]

  try:
    response = model.generate_content(prompt_parts)
    print(response.text)
  except Exception as exception:
    print("Error generating response:", exception)

if __name__ == "__main__":
    init_api_keys()
    prompt = input("> ")
    generate_response(prompt)

hello,do you know how to use this api to get answers for video input

I use the code and here is the error information: Error generating response: Timeout of 60.0s exceeded, last exception: 503 failed to connect to all addresses; last error: UNKNOWN: ipv4:<IP_ADDRESS>:443: Failed to connect to remote host: FD Shutdown

you need to see the documentation on how to send video objects with your request.

I have read in this stack-overflow post that you need to change to api version to beta.
https://stackoverflow.com/questions/78327178/model-not-found-when-using-gemini-1-5-when-i-have-access-to-1-5
And it seems to be supported by this page on the gemini docs.
https://ai.google.dev/gemini-api/docs/api-versions
The problem is that I have no idea how to implement this in code (dart). If any has any idea I would appreciate the help.

I have read in this stack-overflow post that you need to change to api version to beta. https://stackoverflow.com/questions/78327178/model-not-found-when-using-gemini-1-5-when-i-have-access-to-1-5
And it seems to be supported by this page on the gemini docs. https://ai.google.dev/gemini-api/docs/api-versions
The problem is that I have no idea how to implement this in code (dart). If any has any idea I would appreciate the help.

I'm not a dart guy but looks like you need to use requestOptions:
https://github.com/google-gemini/generative-ai-dart/blob/f3be7bbae79534535ef964e5b0fee5874aef9bdc/samples/dart/bin/function_calling.dart#L42

I have read in this stack-overflow post that you need to change to api version to beta. https://stackoverflow.com/questions/78327178/model-not-found-when-using-gemini-1-5-when-i-have-access-to-1-5
And it seems to be supported by this page on the gemini docs. https://ai.google.dev/gemini-api/docs/api-versions
The problem is that I have no idea how to implement this in code (dart). If any has any idea I would appreciate the help.

I'm not a dart guy but looks like you need to use requestOptions: https://github.com/google-gemini/generative-ai-dart/blob/f3be7bbae79534535ef964e5b0fee5874aef9bdc/samples/dart/bin/function_calling.dart#L42

Thanks man that seems to have done it


Invalid 3D enclosure files

Both PrusaSlicer and Infusion 360 have errors when trying to open the STL and F3D files respectively.
PrusaSlicer gives (for all *.stl files):
PrusaSlicer has encountered an error
Loading of a model file failed.

And Infusion 360 gives (for all *.f3d files):
The path C:/Users/*****/AppData/Local/Autodesk/Autodesk Fusion 360/*****/W.login/F/_OP_Lower.9fae7673-a594-4304-a112-c846235622a4.f3d is not a valid zip package.

I was just able to download the Open Pill .stl files and they loaded into Prusa Slicer just fine. I have also spoken with people who have been able to successfully download and work with the Fusion 360 files. Perhaps try downloading the entire repo as a .zip file and extracting the files you're seeking that way?

My bad, solved by not doing "save link as" (which still prompted to save as STL) but clicking on the STL file then clicking the "Download" button in GitHub. Thanks for your swift assistance!

Glad it's resolved!


Connect Source Type and Description to Firebase

Save source type and description along side the results in firebase

The fields are linked to the firebase database, but the description is not taking input.


added --reset-key and black style badge

fixed issue #30

Thank you for the PR.
These changes do not address all the suggestions mentioned in the issue.

Additionally impement API key validation. Since OpenAI doesn't have dedicated endpoint just for key validation, call https://api.openai.com/v1/completions with some test prompt, make sure response status code is not 403, if so, ask user for valid API key.

ill do this later. ty for pointing it out.

Here is a sketch for a key validator:
import openai

def is_api_key_valid(key):
    try:
        openai.Completion.create(
            api_key=key,
            engine="davinci",
            prompt="This is a test.",
            max_tokens=1
        )
    except:
        return False
    else:
        return True

# Check the validity of an API key
api_key = 'YOUR_API_KEY'
api_key_valid = is_api_key_valid(api_key)
print("API key is valid:", api_key_valid)

This should work because the completion api create method calls its super method.  This method  allows us to  pass an api key.
Note I haven't tested or integrated this yet.


[WIP] use 5th-order hybrid PPM/WENO reconstruction

This implements the 5th-order hybrid PPM-WENO reconstruction method of Rider, Greenough, and Kamm (2007): https://ui.adsabs.harvard.edu/abs/2007JCoPh.225.1827R/abstract
The number of ghost zones required is the same as PPM (4, if shock flattening is enabled).  If high-order conservative-to-primitive conversion is done, then 4 additional ghost zones are required (8 total).
Note that only the reconstruction is 5th-order. The overall order of accuracy in space in still 2nd order.

/azp run

/azp run

HydroBlast3D test does not conserve energy.
Is this because of the pressure floor? Or a bug in the flux correction? This issue blocks merging into development.

/azp run

/azp run


WIP: Issues with zero sized arrays and slice

This PR provides an example that triggers the issues with zero sized arrays and slices.

Side note: In the FTG interface there is already a workarounds like this for that issue:
IF (SIZE(field) > 0) THEN
    CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
    CALL ftg_add_field_metainfo(TRIM(fieldname), 'ftg:registered_only', .FALSE.)
ELSE
    CALL ftg_register_only_internal(fieldname, 'int', fs_intsize(), lbounds, ubounds)
END IF

But of course, it would be nice, if zero-sized arrays will work without that.

Another side note: Just yesterday, GitHub announced a new feature for such WIP pull requests

Introducing draft pull requests

I guess @phmarti doesn't care about this anymore.


Create new occupants in Brick model

Create new occupants based occ01's format. Spcify x,y location, gender, and acceptability range for each occupant.
https://github.com/ZhelunChen/HILFT-IBAL-DEMO/blob/4a738976152b38dea51847bf8c259e7414f7d2c8/assets/brick/HIL_IBAL_Brick_v1-3-0.ttl#L681C1-L756C22

After completing 1, copy paste and create a seperate file HIL_IBAL_Brick_v1-3-0_DenseOcc.ttl and add more occupants.

Done


Wrong validation for Zip-code field.

Log in into Vuestorefront
Go to My Account→ My shipping details
Edit your shipping details
Type three letters into Zip-code and try to save changes

Actual results:
Wrong validation.

Expected:
It should be possible saving three letters or notification should be changed (for example "Zip-code must have at least 5 signs"

@pkarw Could you reopen this issue?
I find new place where Zip-code is valid, even when user provided 4 letter, see:

It is for logged user, when user edit My profil - /my-account page
Tested on https://test.storefrontcloud.io

@ibugaj thanks


[fixed] Getting "Duplicate 'content' items were included" error when updating from 1.1 to 2.0

Getting "Duplicate 'content' items were included" error when updating from 1.1 to 2.0.
Windows machine, with VS 2017 15.3
I noticed that my .csproj file had:
<ItemGroup>     <Content Include="wwwroot\js\add-subscriptions.js" />     <Content Include="wwwroot\js\appusers-dt.js" />
I fixed the issue by manually changing the back slashes to forward slashes. This shouldn't be something users would have to manually fix, IMO.

You can probably remove those lines of code altogether. VS may have added them automatically for you, but they should be unnecessary. Projects using Microsoft.NET.Sdk.Web have everything in  wwwroot in "Contents" by default:
Cref: https://github.com/aspnet/websdk/blob/rel-2.0.0/src/ProjectSystem/Microsoft.NET.Sdk.Web.ProjectSystem.Targets/netstandard1.0/Microsoft.NET.Sdk.Web.ProjectSystem.props#L28

I did, but I thought I'd report this "issue" here so that you guys can either put a fix or notify the VS team to remove or stop adding those extra lines that cause more harm than benefit with these 1.1 to 2.0 upgrades.

VS bugs are best reported directly through the VS feedback tool.


Make entire event clickable

https://user-images.githubusercontent.com/1093738/129501229-78f68751-f751-40b5-a131-b6c6cf388cd2.mp4

https://www.loom.com/share/fb4a66a841fe41fb9f63835b6826b5e3

Issue added for focus styles: https://linear.app/statelyai/issue/STA-503/focus-styles