Provide a way to log successful and failed requests

Motivation:
To diagnose an exception error on the client-side, request logs are important to check request parameters, response duration and application errors.
Modifications:

Add RequestLogConfig which can limit the sampling rate, adjust target groups, and set the logging levels.
TransientServiceOption.WITH_SERVICE_LOGGING is specified to HealthCheckService or PrometheusExpositionService
if METRICS or HEALTH group is defined in RequestLogConfig

Result:

Logging configuration example:{
  "targetGroups": [ "API", "HEALTH" ],
  "loggerName": "centraldogma.test",
  "requestLogLevel": "DEBUG",
  "successfulResponseLevel": "DEBUG",
  "failureResponseLevel": "ERROR",
  "successSamplingRate": 0.4,
  "failureSamplingRate": 0.6
}

Fixes #718

Could a user specify different logging settings for different target groups? For example, a user might want to lower the log level or rate for WEB but not for API.
Can we also add OTHERS, which is used for all other requests?
How about categories rather than target groups?


Standardize sizes of items/posts/etc.

Also verify if images are loaded with a delay that the layout doesn't need to adapt


Shared session between Tomcat Session Manager and Spring Boot Redis Session

Hi.
In our organization, we are building a new version of our website on Spring Boot and we are using Redis for session storage via spring session data redis. In our old application, session is stored in tomcat memory. As for now, we are trying make to the application share session data, by updating our old website with Tomcat Session Manager, but we are having an issue with synchronizing data and session expiration strategies and session data.
Spring Session

Tomcat Session Manager

Is there any way to synchronize the way, how these modules work with sessions other than writing implementation or put spring boot application in nonembedded mode?

Data format used by Tomcat Session Manager isn't compatible with Spring Session manager.


🐛 BUG: site.bucket should be resolved relative to wrangler.toml

What version of Wrangler are you using?
2.0.9
What operating system are you using?
Mac
Describe the Bug

cd examples/legacy-site-app && wrangler dev
Open localhost:8787 and the page loads as expected
cd workers-site && npx wrangler dev index.js
Open localhost:8787 and you'll see a message could not find index.html in your content namespace

I think this is because we don't modify site.bucket to be resolved relative to the path to wrangler.toml.

Hmm we already account for the config path here https://github.com/cloudflare/wrangler2/blob/f8a21ede2034f921b978e4480fe2e6157953a308/packages/wrangler/src/sites.tsx#L283-L285 so it must be something else...


[CARBONDATA-1821] Updated md files for correcting heading

Be sure to do all of the following checklist to help us incorporate
your contribution quickly and easily:

[ ] Any interfaces changed?

[ ] Any backward compatibility impacted?

[ ] Document update required?

[ ] Testing done
Please provide details on
- Whether new unit test cases have been added or why no new tests are required?
- How it is tested? Please attach test report.
- Is it a performance related change? Please attach the performance test report.
- Any additional information to help reviewers in testing this change.

[ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

Build Success with Spark 2.1.0, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder1/1531/

SDV Build Fail , Please check CI http://<IP_ADDRESS>:8080/job/ApacheSDVTests/1930/

Build Success with Spark 2.1.0, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder1/1533/

SDV Build Success , Please check CI http://<IP_ADDRESS>:8080/job/ApacheSDVTests/1931/

SDV Build Success , Please check CI http://<IP_ADDRESS>:8080/job/ApacheSDVTests/1932/

Build Success with Spark 2.1.0, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder1/1535/

SDV Build Fail , Please check CI http://<IP_ADDRESS>:8080/job/ApacheSDVTests/1934/

SDV Build Success , Please check CI http://<IP_ADDRESS>:8080/job/ApacheSDVTests/1936/

SDV Build Fail , Please check CI http://<IP_ADDRESS>:8080/job/ApacheSDVTests/1937/

retest this please

LGTM

Build Success with Spark 2.1.0, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder1/1546/


urh: 2.0.2 -> 2.0.4

Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools.
This update was made based on information from https://repology.org/metapackage/urh/versions.
These checks were done:

built on NixOS
ran ‘/nix/store/g2bnnh1shkjhn7jyvjfrjyfv7li4wrld-urh-2.0.4/bin/.urh-wrapped --version’ and found version 2.0.4
ran ‘/nix/store/g2bnnh1shkjhn7jyvjfrjyfv7li4wrld-urh-2.0.4/bin/urh --version’ and found version 2.0.4
found 2.0.4 with grep in /nix/store/g2bnnh1shkjhn7jyvjfrjyfv7li4wrld-urh-2.0.4
directory tree listing: https://gist.github.com/f984d6b54a7cfcf840ab5c9a24c0ac95

cc @fpletz for review

Success on x86_64-linux (full log)
Attempted: urh
Partial log (click to expand)
shrinking /nix/store/ypqx9r60gshwmkawjz1bibm9anakbvwh-urh-2.0.4/lib/python3.6/site-packages/urh/cythonext/signalFunctions.cpython-36m-x86_64-linux-gnu.so
shrinking /nix/store/ypqx9r60gshwmkawjz1bibm9anakbvwh-urh-2.0.4/lib/python3.6/site-packages/urh/dev/native/lib/hackrf.cpython-36m-x86_64-linux-gnu.so
shrinking /nix/store/ypqx9r60gshwmkawjz1bibm9anakbvwh-urh-2.0.4/lib/python3.6/site-packages/urh/dev/native/lib/rtlsdr.cpython-36m-x86_64-linux-gnu.so
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/ypqx9r60gshwmkawjz1bibm9anakbvwh-urh-2.0.4/lib  /nix/store/ypqx9r60gshwmkawjz1bibm9anakbvwh-urh-2.0.4/bin
patching script interpreter paths in /nix/store/ypqx9r60gshwmkawjz1bibm9anakbvwh-urh-2.0.4
checking for references to /build in /nix/store/ypqx9r60gshwmkawjz1bibm9anakbvwh-urh-2.0.4...
wrapping `/nix/store/ypqx9r60gshwmkawjz1bibm9anakbvwh-urh-2.0.4/bin/urh'...
postPatchMkspecs
/nix/store/ypqx9r60gshwmkawjz1bibm9anakbvwh-urh-2.0.4


Alarm clock set by Calendar

The widget displays only today's alarms, in other cases the widget says that the alarm will be at midnight, and the settings say 'Alarm clock set by Calendar'.
I expected the widget to show the nearest alarm clock.
Screenshots:

Smartphone: Xiaomi Redmi 8A
Android version: 10 QKQ.191014.001
App Version: v2.2.2 (127)
Sorry if there are errors in the text.

#158

#158


show the player's health when describing them for look

Include the current health stat of any player characters when describing them for the look command, as a target or otherwise.

Duplicate of #111, should also shown in #114.


[bugfix] fix serper integration bug to support batch queries

If met "a|b" query, the implementation would be wrong.

This pr is behind the main branch a lot. Please rebase it first.


Create inception_v3.py

add inception_v3

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


windows 10 no audio with notificaitons

Bug description:
notification flag appears as soon as message come in but no audio. (native telegram is delayed but audio works). the notification is super fast which is what im looking for but with out sound its useless.
Steps to reproduce:
window 10 pro latest version install nightly MSI 5.6.1 - 14. Install telegram service enable all notification and receive a message. copy latest recipe files
Expected behavior
audio sound should have played when notification flag came up.
Screenshots

Environment:

Operating System: windows 10 pro 20H2
Ferdi Version: 5.6.1 - 14
Server: Using without an account
Debug information:

Please check in the next nightly (v5.6.1-nightly.36) whether this is fixed. The related PR is #1823

I tried 36 and 38 nightly and still no audio. The notification badge beats the telegram app by many seconds but only the native telegram app gives audio.  I toggled notification and audio on/off no help, with just audio on i get nothing with notification on just notification. both enabled just notification bubble. Let me know if you need any more data but i had a friend install it and same issue, also installed on a windows 10 laptop and same thing. thanks

More info, on a Apple MAC i am getting the same problem, just to the notification badge comes up. Is there not a way to play sounds natively in the APP so you can play a sound file so it bypasses the operation system notification system? this would also allow for custom sounds. thanks.


Using this addon in an acceptance test causes "Assertion after the final assert.async was resolved" errors

There is a known issue about this w/ qunit v2 in ember apps (i.e. ember-cli-qunit 3.x), but for some reason, the suggested workarounds are not working in the one app I've seen this issue in. See https://github.com/ember-cli/ember-cli-qunit/issues/162#issuecomment-289235561 Don't know if that's a sign of a fundamental issue w/ this addon, or that app, the way I tried to do the workaround, or a symptom of a broader problem.
Until that issue is resolved, we should try other workarounds (downgrade ember-cli-qunit version in that app), try the addon in other apps, and document the issue and any successful workarounds in the README.

Closing this b/c I'm no longer getting "Assertion after the final assert.async was resolved" errors, but I am having other errors w/ Acceptance tests, see #27 and #28.


changed signature to match getphyllo readme signatures

Updated readme
Removed PhylloEnv.development
Updated PhylloConnect.on(eventName, callback) to phylloConnect.on(eventName, callback)
Added validators

Closed this PR
reason: To follow the new development style
new pr link => https://github.com/getphyllo/phyllo-connect-reactnative/pull/5


add custom buttons for previous and next source #feature

Hi, I hope u doing well,May you please implement a way to add next and previous source as optional widget.
It helps when you are trying to run episode of series , multiple tv channel.

You can implement it in the header widget


APC / Schneider Electric Powerchute Network Shutdown

Submission Template
Please provide the following information.

Vendor Name APC / Schneider Electric
Product Name Powerchute Network Shutdown
Version(s) affected 4.4.1, 4.4,4.3,4.2
Status:  Fixed
Update Available:  No
Notes Mitigation instructions to remove the affected class
References https://community.exchange.se.com/t5/APC-UPS-Data-Center-Backup/Log4-versions-used-in-Powerchute-vulnerable/m-p/379866/highlight/true#M47345
Last Updated:  2021/12/15

Issue addressed by PR #242

@AHelsby thank you for the submission.


Made changes to the README file for nightly build

As a beginner it took me time to realize that $ cargo build --release is throwing an error because the unstable versions are already available in the nightly build and one needs to install nightly first.

Thanks!


Video is broken

https://code.pybricks.com/static/docs/start_pup.html#installing-the-pybricks-firmware

The installation guide isn't part of these docs.
This will get fixed once the latest Pybricks-code is published, which has the new docs.


Just some code refactoring to make the code more clean and readable.

I hope you'll appreciate some code refactoring and code optimisation.

Thanks for the changes for refactoring and code opt.
Sorry that I was focusing another feature #12, forgot this pull request and pushed changes to the master branch which made this pull request out of date.
If you don't mind I will do the refactoring in later changes.

Sure, don't worry. I will have a look at the latest commit and perform a code optimisation according to that.
I made some improvements in my local version you would probably like to have in your repository as well.
I will send you a new pull request soon. :)


Error when excluding files with a backslash in the filename

VSCode Version: Code 1.15.0 (8b95971d8cccd3afd86b35d4a0e098c189294ff2, 2017-08-09T20:06:21.685Z)
OS Version: Darwin x64 16.6.0
Extensions:

Extension
Author (truncated)
Version

vscode-docker
Pet
0.0.16

gitignore
cod
0.5.0

vscode-eslint
dba
1.2.11

githistory
don
0.2.3

gitlens
eam
4.3.3

tslint
eg2
0.17.0

vscode-npm-script
eg2
0.2.0

git-project-manager
fel
1.3.2

docomment
k--
0.0.17

mssql
ms-
1.1.0

csharp
ms-
1.12.1

mono-debug
ms-
0.15.7

debugger-for-chrome
msj
3.1.7

vscode-icons
rob
7.12.0

vim
vsc
0.9.0

Steps to Reproduce:

Add a file to the project folder containing a backslash, e.g. c:\log\example.txt
a. File appears in Explorer view
Add a rule to the files.exclude setting, e.g.: "**/**\log\**": true
a. File is excluded from Explorer view
b. Error appears for settings.json in Problems view: Invalid escape character in string
Replace rule in files.exclude to escape backslashes, e.g.: "**/**\\log\\**": true
a. File is not excluded from Explorer view
b. No error appears for settings.json in Problems view

Reproduces without extensions: Yes

Assigning @sandy081 for config and @isidorn for explorer.

Since files.exclude setting is of string type, value should be valid. So, backslash should be escaped. I do not think config service should unescape it while reading but Whoever is asking this value should be aware of this and unescape it.

@sandy081 I agree that the value is valid, however what I do not understand is why each configuration service client should unescape values they are getting from the configuration service.
Doesn't it make more sense that configuration service unescapes all string values?
Currently we have 5+ path settings that would all need to adop this code. Why not keep it centralized in the configurations service?
Also it goes well with our current conecpt of the configuration service -> it gives you the truth for that setting, not what is actually written in a file.

Will investigate more and get back to it.

Unassigning myself.
@sandy081 assign back to me if you come to the conclusino that each configuration service client should escape seperatly.

@isidorn Agreed with you.
@aeschli I think, it makes sense that the JSON parser does the escaping of strings.

@isidorn After debugging, I see the value comes as unescaped from configuration service

Since you are using the key as regex, you have to escape it back for to be regex compatible.
@aeschli You are off the hook

I suspect, this also impacts Search land
@roblourens FYI

@sandy081 well that is exactly what I am saying a couple of somments above. However I believe the configuration service should escape it (reasons specified above). https://github.com/Microsoft/vscode/issues/32533#issuecomment-328102584

Chrome devtools usually writes a single \ for a value with a literal backslash:

I think, it makes sense that the JSON parser does the escaping of strings.

Maybe I misunderstand, but \l from the original repro is just not a valid escape sequence and it should error, not be parsed as a literal backslash + L.

@roblourens You are looking at JavaScript literals. JSON is more strict, \1 is not valid there. See http://json.org/ for details. The JSON parser correctly gives an error ('Invalid escape character in string'), but tries to be nice still return a object to work with.

What actually needs to be done here?
In https://github.com/Microsoft/vscode/issues/38464#issuecomment-346542331 @bpasero says that backslashes are not valid in glob patterns anyway.

I was looking at #50098 and remembered this. The current state is that glob.ts doesn't support globs with backslashes. We need to decide whether we support globs with backslashes or not. If we do, we either change glob.ts to support backslashes in globs or normalize the slashes before passing them to glob.ts.
I don't think there is an issue around how the actual backslash is escaped or not escaped, it works as JSON should.
I vote that we close this and don't support backslashes in globs. On Windows right now, a pattern like build\\**\\*.js will appear to work but only to depth=1. The way it's handled by glob.ts, it will match build/*.js but not the **.
We could leave that behavior to avoid breaking people who are relying on this but show a validation error in settings for globs that use backslashes (maybe? can we do that for values in objects?)
This also leaves backslash to use to escape special characters in filenames. I could name a file foo*.js and match it with "foo\\*.js": true


implementation -> module?

A little bit confused here, not sure if it means module originally.

This change is

No, implementation was the right word here


fix: ios 17 .low file format from gallery

https://github.com/filestack/filestack-ios/issues/78

Done by https://github.com/ekreative/filestack-ios-temp/commits?author=ArturKvaratsheliaEkreative

Another solution https://github.com/filestack/filestack-ios/pull/79/files


FunctionSeries

It is often very practical to draw a regression on a plot. It can linear, polynomial, etc...
In order to draw this regression it could be useful to have a new kind of Series that is called FunctionSeries.
This series would have as property a callback that allows to calculate y depending x. I have no idea about a good name for this property...
In contrast with other Series there would be no way to determine the min,max values of the axis so either we need to force them or to rely on other series that may be present in the plot.
This will allow to recalculate the points when zooming in the plot.
As an example you can use one of the plot of the iris dataset and add 2 FunctionSeries. One is the linear regression and the other one would use as developper dependency https://github.com/mljs/regression-polynomial and would calculate a polynomial regression of degree 3.
https://github.com/zakodium/react-plot/blob/ee1483d248e5585a7a48c54c7c31eb8ca50db30a/stories/examples/iris-dataset.stories.tsx#L53-L66
In the example you should also activate the square zoom so that we can check the recalculation.
@targos @stropitek What do you think ? If this sounds interesting we could ask Wadjih (and add the corresponding label).

The property could be called getY


Implement the landscape better

Ref: http://www.sibylmoon.com/a-procedurally-generated-wilderness/
Also improve descriptions as a result. People will name each area something unique (to them) and refer to that instead of just the generic terrain type.

Happy with what I've got now, though there are some obvious improvements marked with TODOs in the code.


Micrometer Score Logging

Hi Developers, I am trying to log custom metrics besides the one provided in the doc. Can you please point me to the part of the Optaplanner where you introduced the MIcrometer to manage Metrics discussed in the documentation? I could use it as a reference to solve my problem
Thanks

Please use stackoverflow or our discussion forum for questions
https://www.optaplanner.org/community/getHelp.html
Answer: See BEST_SCORE monitoring here https://www.optaplanner.org/docs/optaplanner/latest/planner-configuration/planner-configuration.html#_additional_metrics


Firebase Hosting

Hello there, Nuxt is great and I'm newbie. I don't really understand the way to deploy the Nuxt Project.
When I run npm run build , it create a dist and inside there's 2 directories, one is client, and the other one is server.
I firebase init the dist and it create a new index.html . Which is totally not related to what we code.
How to deploy it properly? Am I missing something out there? And is it possible to achieve SSR by simply using firebase hosting(no cloud function)? Thank you!

This question is available on Nuxt community (#c8601)

I did try to ask on  https://otechie.com/nuxt
but it request me to do a payment.
It's super duper unfriendly to student. VERY DISAPPOINTED.

@b02505048

Please read what the bot or the issue template is telling you. You should use CMTY to filean issue (https://bug.nuxtjs.org/). You don't have to use Otechie for that.
If you do: Payed consulting means payed consulting.

To answer your question, you do firebase init in your project root, and set the dist directory as the firebase hosting root. Then, setup the rewrite.
In my case, I used nuxt generate and upload the entire dist directory to firebase.
This is how my firebase.json looks like
{
  "hosting": {
    "public": "dist",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/200.html"
      }
    ],
    "cleanUrls": true
  }
}

And I agree that there's nothing to be disappointed about payed consulting. No one is responsible for answering your question, especially for a question that can be easily looked up

Oh and index.html was automatically generated by Nuxt. And it's generally impossible to achieve SSR with only static hosting, since SSR means Server Side Rendering. How do you do server side rendering without a server?
So either deploy a SPA or use nuxt generate to generate the entire site.


[ID] Add an easy way to view all grants without messing with eligibility codes or keywords

This could expand to something further, such as having sets of saved eligibility codes. But what's the MVP for this user journey?

will be addressed by the saved search feature proposal. Closing.


Fix validation of numerical parameters passed as strings

Motivation: big numbers validation in various places was incorrect because it was casting the value to native js numbers which do not work well over a certain threshold lower than 2^64, The used safe_parseInt function thrown (as it was designed to) for numbers over max safe integer in javascript, so numbers over that threshold (~2^53) were basically causing ledgerjs validation to fail and the transaction was not passed to Ledger.
I was originally planning to just extend the original simplistic validation of integer strings but it got awkward when I wanted to generalize it for uint64 and ADA amount (adding a min-max range to the function interface) and there is also validation comparing pool margin numerator and denominator.
So it felt kind of shortsighted to create a relatively ugly helper function that would require further "hacking" as more numbers with different constraints would be introduced. Therefore I went with JSBI library implementing ES2020 BigInt. I considered using BigInt directly but it seems to be too "bleeding edge" and it may not work in older, but still relatively new browsers and developers may face unnecessary issues with that. Moreover, it seems tricky to be translated by Babel: https://javascript.info/bigint#polyfills and the plugin that I found for it https://www.npmjs.com/package/babel-plugin-transform-bigint doesn't seem very stable and well adopted and I didn't manage to get it working, it was failing with Error: Cannot find module './jsbi.mjs'
Changes:

refactor validation of numbers to use BigInt (JSBI)
add testcase containing a transaction with big numbers

Testing:

yarn test-integration passes

I am not sure I like adding another external dependency, just for the sake of parsing few numbers. Are we sure we

need to allow transactions with such large values? (though I agree it would be nice)
can't we use native bigint? https://caniuse.com/bigint seems to suggest that front-runners (edge, Firefox, Chrome are very happy with it. Unless IOHK uses ages-old electron (i.e. node <v10), we should be fine with native approach). The only struggle I see is Safari which added the support only recently (Sept 2020). Alternatively, I know "bignumber.js" to be quite reliable, has 10x the npm downloads and shouldn't need transpilation

I suggest we open discussions with Emurgo/IOHK whether we can actually use native bigints in the followup refactor. It would be nice to get rid of all the "str" values and use native ones. (We could still throw LossOfPrecisionError if we detect using float for values >2**53)

@ppershing regarding point 1 - there can be legitimate transactions on testnet that big (we got a bug report from IOHK related to that) and the custom tokens also let anybody deal with such big numbers even on mainnet
regarding point 2 - using native bigint in a library potentially used by anybody is imho a needless risk towards the products that are integrating with it. Would they be able to do something if they for example needed to work with an older Safari browser or node version 8 (the latest LTS)? And even if we confirm with IOHK/Emurgo they are OK with BigInt, the library is public, so there may still be somebody else getting blocked by this we didn't account for. bignumber.js is another alternative of course, though it also offers operations with decimal numbers which we don't really need and doesn't have the benefit of being transpilable into native BigNumber once we choose t, though that's probably not that big of a deal
Finally, we may need to work pretty soon with negative numbers (minting of tokens) as well so that can complicate things further if we wanted to keep our own implementation for parsing/validating numbers but that it's a fair point that line of thought falls into premature optimization.
All in all, to not hamper the upcoming refactoring and incur the cost of an additional library, I'd rewrite it to use our own function. Imho using native BigInt in the interface is risky even if we got the heads up from Emurgo/IOHK, ironically Adalite, our own product. may face the most issues as a browser based wallet meant not just for the most mainstream ones and there may not be a reasonable way to work around the problem should users with older browsers face issues with this. But that's a discussion we don't need to decide on now

@ppershing I removed the external dependency, it turned out quite acceptable IMHO, you can check again


changeable url

Hi
The settings for the fixed page are fine, but I want to use the page whose url changes

Can you please provide some sample of URLs. Our extension support regex patters to check URL.
docs

Dhruv-Techapps<EMAIL_ADDRESS>در تاریخ دوشنبه ۱۳ ژانویهٔ
۲۰۲۰ ساعت ۱۳:۵۶ نوشت:

Closed #94
https://github.com/Dhruv-Techapps/auto-click-auto-fill/issues/94.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Dhruv-Techapps/auto-click-auto-fill/issues/94?email_source=notifications&email_token=AFAITQ43RB3DCLGGMSLJKX3Q5Q6VPA5CNFSM4KFDKIQKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOV5SJTQQ#event-2942605762,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFAITQYIKRHYZ2QA3HS625DQ5Q6VPANCNFSM4KFDKIQA
.

Say if we set the extension for an autologin into a site. So first the url would be like http: //www.site.com/login and the we want the extension to continue then the url would have changed to something like http: //site.com/admin. So the plugin throws error that it cant find the element. It is obvious because the configuration is set for http: //www.site.com/login only.
@ghost the link you provided gives a 404.


Removing streams from snapshot functions

Since the later version of js-ipfs don't require streams as input to add, we can remove those and save ourselves some hassle. What do we think?

@oed curious on your thoughts about this - will this mess up anything you're doing? :D

I don't think so as we are not using snapshots. Thanks for asking @aphelionz :)


[WIP] Rework of name validation

Still in work, published only for check test cases (sorry :( )
Huge summary would be later, where I would explain why I decided rework whole name validation and why I not choose regexps
But I would appreciate if someone would make review even on this code :)
UPD: And of course I will show some benchmark reports to prove my solution

 Quality Gate passed
Issues  0 New issues  0 Accepted issues
Measures  0 Security Hotspots  95.5% Coverage on New Code  0.0% Duplication on New Code
See analysis details on SonarCloud

And please help me, idk why I can`t reach 100% of test coverage :(


Importing Visio VSDX: Cropping of graphics is not applied

Preflight Checklist

[X] I agree to follow the Code of Conduct that this project adheres to.
[X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug
When importing the Visio 2013 VSDX 2080261 HG1.zip the cropping of the images is not applied.
To Reproduce
Steps to reproduce the behavior:

Open draw.io in the browser
Drag-and-drop the given file onto the drawing area or use the import method from the menu

Expected behavior
Cropped images as in Visio.
Screenshots
Visio:
Overview:

Cropping of top right image:

draw.io:

draw.io version (In the Help->About menu of the draw.io editor):

draw.io version 21.1.8

Desktop

OS: Windows 10 Pro 22H2
Browser: Chrome
Version: 111.0.5563.147 (Offizieller Build) (32-Bit)

Will be fixed in the next release
Thanks for the report

Change in 21.1.9


Migrate BackrollSessionCallbacks into an interface or abstract class

The C style of passing callbacks works for a C/C++ implementation like GGPO with a C BPI, but does not work well in a C# environment. It might be better to set up a interface or abstract class. There are several benefits of this:

No functor overhead via using delegates.
Compile time enforcement of correctness, and improper assignment at runtime is impossible.
Some of the callbacks take structs passed in as refs. Delegates will take non-ref arguments as valid matches, which will break saving/loading functionality.

On point one, the functor overhead is the same as a virtual call. http://kennethxu.blogspot.com/2009/05/strong-typed-high-performance_15.html

On point one, the functor overhead is the same as a virtual call. http://kennethxu.blogspot.com/2009/05/strong-typed-high-performance_15.html

At this rate, please use UnityGGPO, I'm more focused on maintaining the Rust version of this library than the Unity C# one.


Add whitespace between each page of text from PDF

Previous logic concatenates each page of text without a space between each page.

Don't mind the force push - removed an accidental push on the wrong branch.


Use a function-local static variable to replace globals

We recently added global variables to avoid breaking ABI (#22). To avoid the static initialization order problem, this PR changes the globals to function-local static variables via the construct-on-first-use idiom per the Google style and C++ Core Guidelines.

I believe the CI failures are related to #28? They seem pre-existing

Yes, I was able to fix the failures by relaxing the tolerances in the upstream PR https://github.com/dartsim/dart/pull/1437. I can do the same for our fork.


[Question] How to change configuration parameters for 16KHz or 24Khz training data

I'd like to change sampling rate of training data to 16KHz or 24KHz.
What should I change configuration parameters(config/default.yaml) except of sampling_rate?
Thanks in advance.

@twonine1 change following parameters on config files :
generator_ratio:
filter_length:
hop_length:
win_length:
sampling_rate:

for 16KHz
sampling_rate: 16000
hop_length: 200 and filter_length = win_length = 4 * hop_length
generator_ratio: [5, 5, 2, 2, 2]

for 24 KHz
sampling_rate: 24000
hop_length: 300 and filter_length = win_length = 4 * hop_length
generator_ratio: [5, 5, 3, 2, 2]

Thank you very much!


A simple option to choose TV logos source

**Is your feature request related to a problem?
Yes.
I would like to have an option where I can choose the source of TV logos, to either use m3u or xmltv as a source.
Currently,  all the logo's are used from the xmltv source, but, some logos are broken and I would prefer to use the Logo's I've configured with my m3u editor, these logos are found in the m3u playlist.
A clear and concise description of what the problem is.
Because some logos dont exist in the xmltv source, I aways have to set them manually. It is frustrating to set them up manually.
Thanks for understanding!
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

This setting is in TiviMate which uses just the opposite approach. The m3u is the main supplier of Logo's but I prefer the ones in the XMLTV file.... Good request! Without that option I would have been stuck with the Ugly Provider Logos...
+1

Thanks! I am stuck with this now :)
On Thu, 21 Nov 2019, 18:44 Steve<EMAIL_ADDRESS>wrote:

This setting is in TiviMate which uses just the opposite approach. The m3u
is the main supplier of Logo's but I prefer the ones in the XMLTV file....
Good request! Without that option I would have been stuck with the Ugly
Provider Logos...
+1
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/xteve-project/xTeVe/issues/65?email_source=notifications&email_token=ABJRLJUHK2GR6KB5QNBEH7TQU3JIPA5CNFSM4JP25RY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE3H4OI#issuecomment-557219385,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABJRLJTX2LKBSRMTK4ZUOKDQU3JIPANCNFSM4JP25RYQ
.

My new EPG provider has a horrible library of icons while my m3u has a complete list. Currently, xteve does't use the icons from the m3u like everybody else does. So im stuck with bad ones for now.

Hi,
Any updates with this request?
Thank you!

I'd like to add an additional idea related to this.
I am manually matching channels to an XML file generated by guide2go. While doing that it would be great if there was an option to "re-read" the logo from the xml file.

Hi,
Any update on this request by any chance?

@mar-mei  Do you think this would be easy to accomplish?
I think it would be useful to behave like this:

Have two options "Prefer icons from EPG" and "Prefer icons from playlist"
If an icon is available in the non-preferred source, use that (eg. if "Prefer icons from EPG" is selected, but the EPG doesn't have a icon for a channel, use the icon from the M3U)

The default behavior of xTeVe is already Prefer from EPG, and if not present use from m3u AFAIK.

Ahh, interesting, I didn't know it did that. So just an option to swap the order (prefer M3U over EPG) would suffice.

Just load your m3u first with no EPG, should suffice.

The default behavior of xTeVe is already Prefer from EPG, and if not present use from m3u AFAIK....Then in Mapping, you can override it to whatever you like.

@MCTyler I had spent hours and hours searching for modern network logos yesterday doing this with hundreds of channels and replaced all of them to my liking.  It was fine through the evening but only I woke up this morning to see that Xteve had overwritten all that work with the defaults.  Any way to prevent this from happening in the future?  Personally, I would also like to see an option for local uploads, akin to how Plex allows you to with posters, backgrounds, etc.  Thanks for your time.

The only way xTeVe has ever over-written my logos was when I manually told it to do so...I can't think of anything that would change a manual upload of Logos unless you tick the update logo selection in mapping..Perhaps this is a bug?

The only way xTeVe has ever over-written my logos was when I manually told it to do so...I can't think of anything that would change a manual upload of Logos unless you tick the update logo selection in mapping..Perhaps this is a bug?

You can Bulk Edit that selection to make sure xTeVe doesn't update the logo's you have BTW. If you leave it ticked it will update the Logo, just as advertised.

Bingo.  That's what it was; a misunderstanding on my part.  I had selected that checkbox assuming it needed to be done to use my selection as precedent over the old URL.    I apologize for cluttering this thread.  Thank you very much for the assistance.  🥇

Mentioned above was to load the m3u file first, which yes it wil grab all the logos from my m3u......  Then you load up your epg and it does not link the channels.... so either I have to have epg file logos and channels auto linked (in my epg and m3u as is they are named the same) or have my m3u logo's and manually link every channel.  I have found nothing to work on what should be simple....

@MCTyler any chance you add an option to use the M3U logos per default. i have the same pain as @greenmoonconsulting and @MrC001 i have to load the M3U without xml to have the logo and than add the EPG and then map it manually it's is a pain

I'm not the Dev or a coder. Try one of the forks that have an active Dev. The Dev here is not making any changes.


Only enable CGO for prod builds

Description of the change:
Motivation for the change:
Reviewer Checklist

[ ] Implementation matches the proposed design, or proposal is updated to match implementation
[ ] Sufficient unit test coverage
[ ] Sufficient end-to-end test coverage
[ ] Docs updated or added to /docs
[ ] Commit messages sensible and descriptive

/retest

/retest

/retest

/retest

/refresh


FR v: hint text is in english; not set up to work in both languages

My mistake when originally created it, will fix it

Fixed here: https://github.com/lisafast/react-answers/pull/66


Fixed pose inconsistencies

Hi, thanks for the great work!
I noticed inconsistencies between the fixed pose matrices in mvdiffusion/data and instant-nsr-pl/datasets. I also saw the mentioned bug in https://github.com/xxlong0/Wonder3D/issues/72. I am currently trying to calculate PSNR, SSIM, ... like in the paper. However, I am not sure what camera poses to use when rendering ground truth objects (to compare against).
So my question is should I use the camera poses in mvdiffusion/data or instant-nsr-pl/datasets?

Hello. You can use any poses to render images, but the poses should keep the same relative poses with ours.
Note the provided model is trained using orthographic images, you also need to render orthographic images for evaluation.

So the training is done with top, bottom, right, left, front, back views (instead of front-right and front-left in inference) since they are orthographic views? So I just have to adjust self.view_types  = ['front', 'right', 'back', 'left', 'top', 'bottom'] to generate the reconstructed views. And render the camera poses of GT shapes for evaluation?

Hello. Here orthographic view means using a orthographic camera (without a focal length) to render images.

So the training is done with top, bottom, right, left, front, back views (instead of front-right and front-left in inference) since they are orthographic views? So I just have to adjust self.view_types = ['front', 'right', 'back', 'left', 'top', 'bottom'] to generate the reconstructed views. And render the corresponding camera poses of GT shapes for evaluation?

You may drop an email to me, we can discuss in wechat. May be more efficient.

Thanks for the the help I will try it out! I'll email you if I have further questions.


Implement utmpx.h itens for NetBSD

This PR partially closes #1534
If add the constants, structs and and extra traid implmentation

r? @gnzlbg
(rust_highfive has picked a reviewer for you, use r? to override)

The fails seems not to be related  my code changes

@bors: r+

:pushpin: Commit e8106bd4de072a8578a36686c8e892b7f00d38f2 has been approved by gnzlbg

:umbrella: The latest upstream changes (presumably #1586) made this pull request unmergeable. Please resolve the merge conflicts.

@gnzlbg Do I have to resolve the merge comflicts or the moderators or libc that does that?

Need to fix formatting.

@bors: r+

:pushpin: Commit 40f9253fc995620f038572a90941b82c290f138d has been approved by gnzlbg

:hourglass: Testing commit 40f9253fc995620f038572a90941b82c290f138d with merge 645fd1b73d24209282ae4e5364b3e5d17826185e...

Linux builds failed on CI, dunno why

:broken_heart: Test failed - status-azure

error[E0277]: arrays only have std trait implementations for lengths 0..=32

You are trying to use PartialEq or Debug for arrays with more than 32 elements in your manual implementations, but these impls do not exist. You already are doing the "iterator workaround" for one of the fields, I think you just need to apply it to others.

I did a cargo check --target x86_64-unknown-netbsd and now the check passed

What failed?

The network failed.
@bors: retry

@bors: r+

:pushpin: Commit 5d3c5b9d40ff6bcb125ab4334f201c00cad178c1 has been approved by gnzlbg

:hourglass: Testing commit 5d3c5b9d40ff6bcb125ab4334f201c00cad178c1 with merge a595c08ea81092e338d8fd83036b320d4d8af96b...

:broken_heart: Test failed - status-azure

@bors: retry

:hourglass: Testing commit 5d3c5b9d40ff6bcb125ab4334f201c00cad178c1 with merge d11c858bbc3ff3ec81f3dedaaed74bbed4ef97d7...

:broken_heart: Test failed - status-azure

Can we test again?

@bors: retry

:hourglass: Testing commit 5d3c5b9d40ff6bcb125ab4334f201c00cad178c1 with merge f7fca029442b1af00a83645b55d5f84ba7219f20...

:broken_heart: Test failed - status-azure

I don't known why macOS build fails

Looks spurious. @bors: r+

:pushpin: Commit 6fffc1685cd0191808ec722be47ec057e9cfe472 has been approved by gnzlbg

:hourglass: Testing commit 6fffc1685cd0191808ec722be47ec057e9cfe472 with merge 55f32832670ead29d88e50d106f94bc1d7cfef71...

:broken_heart: Test failed - status-azure

@bors: retry

:hourglass: Testing commit 6fffc1685cd0191808ec722be47ec057e9cfe472 with merge 51ae96a5b0e9b87e947727492433fa316a10ba53...

:sunny: Test successful - checks-cirrus-freebsd-10, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, status-azure
Approved by: gnzlbg
Pushing 51ae96a5b0e9b87e947727492433fa316a10ba53 to master...


Working with XAMPPLITE ?

Hi,
I've set up your plugin and it works fine in HTML Code.
Win 8.0 and ST3, Plugin Vers. 2.4.0
And I get an Errormessage:

Sublime Text
CodeFormatter
Format error:
PHP Warning:  PHP Startup: Unable to load dynamic library '\xampplite\php\ext\php_gd2.dll' - Das angegebene Modul wurde nicht gefunden.
in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '\xampplite\php\ext\php_gettext.dll' - Das angegebene Modul wurde nicht gefunden.
in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '\xampplite\php\ext\php_imap.dll' - Das angegebene Modul wurde nicht gefunden.
in Unknown on line 0
... and many lines more with information of Modules, that cannot be found.
So, can it be, that the plugin doesn't work with XXAMP?
And: What can I do to fix that Error?
Best regards, Tom

@alemanne you need to add php in PATH or modify package settings to include path to php installation
https://github.com/akalongman/sublimetext-codeformatter/blob/master/CodeFormatter.sublime-settings#L3


PR to incorporate maven-antrun-plugin

Thanks, but there are conflicts preventing a merge. Can you please resolve?

Done! Thanks
Chinmay
On Sun, Jan 4, 2015 at 7:17 PM, Christopher Hunt<EMAIL_ADDRESS>wrote:

Thanks, but there are conflicts preventing a merge. Can you please resolve?
—
Reply to this email directly or view it on GitHub
https://github.com/webjars/strip-json-comments/pull/1#issuecomment-68656434
.

Note that the version still isn't correct for an update to 1.0.2.

The library version (upstream) is still at 1.0.2. I made the webjar incorrectly in the beginning. So the snapshot version should be one higher right (or am I completely getting this wrong)?

By convention we attempt to align the pom version with the version associated with the actual project. As @jamesward states, appending a -1 means that we're releasing 1.0.2 again, but slightly revised.

The upstream version is still 1.0.2 and this is an update to the WebJar distribution of 1.0.2 so our versioning scheme is to append a -1 to the version.  So the version will be 1.0.2-1 but the way we do that with Maven is to set the version to 1.0.2-1-SNAPSHOT and then Maven does the actual release.  Sorry this is confusing Maven-isms and WebJar-isms all rolled together into a confusing mess.

Got it. Thanks. Update incoming.
Chinmay
On Sun, Jan 4, 2015 at 7:36 PM, Christopher Hunt<EMAIL_ADDRESS>wrote:

By convention we attempt to align the pom version with the version
associated with the actual project. As @jamesward
https://github.com/jamesward states, appending a -1 means that we're
releasing 1.0.2 again, but slightly revised.
—
Reply to this email directly or view it on GitHub
https://github.com/webjars/strip-json-comments/pull/1#issuecomment-68657150
.

@jamesward: Haha! Oh well, now that I understand, hopefully it should be a lot smoother next time for me. Thanks :)

Cool.  It is really my fault for not documenting this versioning scheme anywhere.  Sorry for the hassle.  Usually it is just me doing these kinds of updates so I haven't tried to educate others on this yet.

This will be released shortly.

:+1:


⚠ Minecraft has degraded performance

In 71f50ee, Minecraft (https://www.minecraft.net) experienced degraded performance:

HTTP code: 200
Response time: 1387 ms

Resolved: Minecraft performance has improved in ebda941.


Transaction Functionality in CLI version

Need to complete the transaction functionality for the command line version of the software as soon as possible.

Completed the transaction functionality in the commit New Bug


Fix error when parsing .gyp file with a backslash

Regarding Unify node.gyp code styling · Issue #41072 · nodejs/node, in node.gyp, multi-line character strings are combined by inserting \ before a line break.
That causes 'Unknown escape character' error in gyp-parser.
This PR is a bug fix on the gyp-parser side.

Thanks, merged and published in 📦<EMAIL_ADDRESS>:+1:


Update gitignore

Create a .gitignore file and include node_modules/ and .DS_Store/ so that your node_modules directory isn't tracked or uploaded to GitHub. Be sure to create your .gitignore file before installing any npm dependencies.

Added .DS_Store to gitignore. Tthe node_modules was already listed.


Access GILProtected via PyVisit

Since you can't access a Python<'_> from within __traverse__, it becomes impossible to access a GILProtected object while traversing, which causes problems if there is an object that needs to be traversed somewhere inside the GILProtected. Seeing as GILProtected::get doesn't actually do anything, this should be a valid operation despite the restrictions imposed during GC.
Rather than rehashing the discussions from previous issues regarding marker access during GC, it seems relatively straight-forward to simply allow access to the inner object using a PyVisit object.

From previous discussions:

I believe you can still borrow PyCell from traverse. We can't use the GIL, but we can still make use of the fact that there is at most one thread with the GIL.

The problem is that PyCell derefs into PyAny which provides implicit access to a GIL token via PyAny::py, i.e. we cannot even expose &PyCell<Self> or any &PyAny to the traverse implementation if it is not supposed to safely assume holding the GIL.

Accessing the GILProtected object can make use of the fact that there is at most one thread with the GIL while also not providing any new access to a GIL token.


When moving a namespace that has workloads with host ports/node ports to "system" projects , network policies relating to  host ports/node ports are not getting cleared.

Rancher versions: Build from master
Steps to Reproduce:
Create workloads with host port  and node ports in namespace that is not part of "System" project.
Move this namespace to "System" project.
After the move, all existing network policies relating to host port  and node ports in this namespace continue to be present in the namespace.
Only hn-nodes  and np-default network policies get deleted.
Expected behavior:
After the move, all existing network policies relating to host port  and node ports in this namespace should get deleted.

rancher/rancher:master 8/6
Network policies are getting removed when moving namespace to System project.
Created a namespace in Default project, containing a workload with a nodeport.
kubectl get networkpolicies --all-namespaces shows network policies for the created namespace and workload.
Move the created namespace to the System project.
kubectl get networkpolicies --all-namespaces shows no network policies for the namespace or workload moved to the System project.


[FEAT] New LoRA Initialization Method: Explained Variance Adaptation

Description
In our work "One Initialization to Rule them All: Fine-tuning via Explained Variance Adaptation" (paper) we introduce a new data-driven initialization method for LoRA adapters. We will present this work at ENLSP  (oral) and AFM at NeurIPS'24.
Eva initializes LoRA in a data-driven manner based on information of the downstream data using SVD. It also adaptively allocates ranks throughout the model.
Implementation Details

As the initialization is data-driven we created a new config class EvaConfig which at minimum needs to receive a value for the dataloader argument. Other parameters have default values which worked well in our experiments. The instantiated EvaConfig is passed as a parameter to LoraConfig. (we took inspiration from the LoftQConfig implementation).
In LoraConfig "init_lora_weights" needs to be set to "eva"
We modify the __init__ method of LoraModel to create a state dict for eva initialzation before initializing the parent class to be able to populate the rank_patternargument in LoraConfig. This way we directly initialize with a modified rank distribution allowing us to directly load the eva_state_dict.
All other code necessary for the initialzation is self-contained in peft/tuners/lora/eva.py
Under examples/eva_finetuning/eva_finetuning.py we add an example script for eva initialization

Open Questions

Not sure if self.model.load_state_dict(eva_state_dict, strict=False) is always a valid way to initialize. E.g. when the model is wrapped with torch.compile
We currently only tested a single GPU setting. We are not sure what the best way is to have multi-gpu support (only run init on rank 0 and copy to other ranks when done?)

Example Usage
eva_config = EvaConfig(
    dataloader = dataloader
)
peft_config = LoraConfig(
    r = 16,
    lora_alpha = 1,
    target_modules = ['q_proj', 'k_proj', 'v_proj', 'o_proj'],
    init_lora_weights = "eva",
    eva_config = eva_config,
)
peft_model = get_peft_model(model, peft_config)

Thanks a lot for this PR. I only skimmed it for now and have yet to read the details from the paper but this looks quite promising!
When looking at the implementation, I saw that the way the Eva weights are initialized sits a bit "outside" of how we normally do this in PEFT. The normal way is to have this on the layer level, check for instance here:
https://github.com/huggingface/peft/blob/5758a7eb1c156b2c513930af666acb2d4a2cb3c3/src/peft/tuners/lora/layer.py#L128-L139
My guess why this is implemented differently here is that there is currently one pass through the modules that determines the individual ranks and creates the state dict. If this was refactored such that the weights were initialized on the layer level as usual, we would need two passes, one to adjust the ranks in the config and then the actual weight initialization on the layer level. Would it be possible to refactor the code to enable that?
My main concern with the current approach is that the weight initialization currently is happening in one place of the code but now there would be another place, making the code more disorganized. Second, IIUC, we would initialize the weights once and then override them with Eva parameters, which is wasteful. Finally, if we do this on the layer level, that could solve the multi-GPU issue, right?
Apart from this, what I noticed while skimming is that there is a big class IncrementalPCA which looks like a rewrite of the equivalent sklearn class using torch. My question is: Did you implement this from scratch or is it taken from somewhere? This has implications on how well this is tested etc.
I also had difficulties understanding the SVDHook and HashHook, could you please add a small docstring? Are these hooks permanently added?
Regarding torch.compile, we could add a test for that and see if it works. But this is not a necessity for this PR to land in PEFT, just something that's nice to have.
Going forward, we'll also have to add a few unit tests, but I'm fine with iterating on the implementation first and then adding the tests.

Thanks a lot for the quick feedback @BenjaminBossan !
I added docstrings to SVDHookand HashHook, hope this makes their purpose a bit more clear.
Regarding your other concerns about the implementation:

I agree its not that our proposed init method is not on a layer level as the other inits. I thought a lot about where in the code to put the init and unfortunately I think it would be quite difficult to put the init directly in the layer. (or at least I haven't found an elegant way to do it). The way eva is initialized is that we do multiple forward passes through the model, and incrementally perform SVD on the input activations of the target layers (usually more than 10 forward passes). The resulting singular vectors are used to initialize the Lora A matrices. So unfortunately 2 passes would also not be enough. We would also need to somehow pass an instance of EvaConfig to the LoraLayer.
I did however add a statement in the update_layer method to intialize the Lora B matrices with zeros as needed for eva. For this reason we do not initialize weights twice as the A matrices are not initialized in the update_layer method.

Regarding the new eva code. IncrementalPCA is indeed largely take from the sklearn class. So a lot of the code is directly copied from there. What we added is seamless gpu support by setting the device for all internal variables / buffers to the device of the first input tensor. We also integrated support for torch.svd_lowrank to significantly speed up computations. We did several tests internally if the results are equivalent when running this on gpu compared to running the sklearn implementation on cpu.

Implementation
I was wondering already if having the dataloader in the confige is a good idea since you probably only want primitive types there. I think your suggested solution is a sensible one. I gave it some thought and dont really have a better suggestion following the restrictions we discussed.
A few questions for clarification:

Would eva still be a valid value for init_lora_weights in LoraConfig. I am a bit worried about discoverability of eva if LoraConfig would then just be normal lora settings and someone needs to know about the function initialize_lora_eva_weights to use eva.
In your suggested solution, would sample data not be a dataloader?
Is it necessary to define a custom forward function for the eva init? Usually it should be anyway the same inputs that the model receives during normal finetuning. I did adapt the line you mentioned filtering out the label key from the inputs dict.
One question about how we get the layer activations for SVD. In the forward hook SVDHook we currently have it implemented like this

try:
    states = input.detach()
except AttributeError:
    states = input[0].detach()

So for cases where we input is a tuple, we just take the first value. Not super important at this stage I guess but I just wanted to ask if you think we should add an argument so the user can define what the inputs we should use are.
IncrementalPCA
It's a good idea to take some from sklearn. All tests for this class are in this file. Right now there is nothing like this available anywhere. I built my own package torch-incremental-pca but I just assumed you dont want any dependencies to small packages like this so I just copied the class over here. I did however create a pull request to have this feature implemented in pytorch directly so in the future we might be able to remove this from peft again.

@BenjaminBossan before going ahead with this implementation of calling a function/method after get_peft_model is called I just wanted to propose one alternative idea to get your thoughts on it.
Instead of using LoraModel we create a subclass EvaModel. This model class initially would not have any adapter layers but we would add the forward hooks needed for the SVD computations. In the __init__ we would have something like
class EvaModel(LoraModel):

	def __init__(self, model, config, adapter_name)
		self.model = model
		for layer in config.target_modules:
			module = get_module(self.model, layer)
			module.register_forward_hooks(SVDHook(config))

During the first few forward passes of finetuning we would not actually update any weights but use the activations to compute the eva state dict. Once SVD is converged for all layers we would switch the internal state of the model to finetuning (with some boolean variable) and at that point only add the adapters with the appropriate eva values for the lora A matrices.
Hope this makes sense. That way we could leverage the finetuning loop directly. It seem a bit more seamless and works without needing any additional function calls after get_peft_model. But of course there might be some hidden issues I am not considering at the moment.

I like the proposal to seamlessly integrate this into the training loop. I'm not sure if we need a separate class for that, but you could come up with a prototype and I can check if there is a good way to integrate it without a separate class.
With this, we would need to make sure that it works with vanilla training loops but also frameworks like Trainer from transformers. If it does, I think this could be the optimal solution.

@BenjaminBossan I started implementing this approach of using the first few batches for the initialization and unfortunately I realised that there are at least 2 major issues with it:

The LoRA layers must be initialized at the beginning of training so that they can be passed to the optimizer. This is especially important if it needs to work out of the box with the HuggingFace Trainer. However, this means that the LoRA weights would take up unnecessary GPU memory that would be needed for the SVD computation. This is btw also an issue with the solution you proposed of doing a normal LoRA init first and then calling a function to initalize eva.
Further, if you use a learning rate schedule, it would already adjust the learning rate while you are still executing the SVD steps. This means that when you start fine-tuning, the learning rate is different from the intended initial learning rate. Especially problematic if there is a warmup I would assume.

These issues makes me wonder if some variant if my initially proposed solution would be feasible (computing the eva state dict before initializing the adapters)
One idea I would have which avoids passing a dataloader or something similar through the config would be to enable the get_peft_modelfunction to accept some optional keyword arguments through **kwargs and passing the dataloader as well as a model forward_fn this way.
def get_peft_model(
	model: PreTrainedModel,
	peft_config: PeftConfig,
	adapter_name: str = "default",
	mixed: bool = False,
	autocast_adapter_dtype: bool = True,
	revision: Optional[str] = None,
	**model_init_kwargs
):
   ...
   PeftModel(model, peft_config, adapter_name=adapter_name, autocast_adapter_dtype=autocast_adapter_dtype, **model_init_kwargs)
   ...

peft_model = get_peft_model(model, peft_config, eva_dataloader=dataloader, eva_forward_fn=eva_forward_fn)

We also don't directly have to modify the __init__ method of LoraModel but define a _pre_injection_hook for LoraModel which should also do the trick.
Let me know what you think about the issues I mentioned with the previously proposed approaches.

@BenjaminBossan thanks for your suggestions, I implemented a prototype solution now for the discussed approach. A few questions:

I moved the IncrementalPCA class which has been adapted from sklearn to peft.utils.incremental_pca.py because I thought it is not strictly part of eva and in theory could be used for other things, does that make sense?
Ideally users should be able to do from peft import initialize_lora_eva_weights`. Would it be suitable to then put this function in peft.utils or should it be in peft.tuners.lora. I didnt see any other functions being pulled directly into the peft namespace from the tuners directory.
I was wondering if we should use low_cpu_mem_usage=True as a default for eva. That way we would even need to have it as an argument for get_peft_model

@BenjaminBossan thanks again for your feedback!

We do pull objects from peft.tuners into the peft namespace, otherwise from peft import LoraConfig would not be possible :)

I pulled initialize_lora_eva_weights and get_eva_state_dict into the peft namespace now. I asked because I only saw classes being pulled from tuners, no functions so I was wondering if there is some rule for that.

How exactly would you do that, given that the get_peft_model is done by the user?

I thought we could just not have a check in the LoraModel.__init__
low_cpu_mem_usage = init_lora_weights="eva" or low_cpu_mem_usage

Regarding tests I adapted some tests from sklearn for the incremental_pca class in tests/test_incremental_pca.py. Could you maybe advice me what the minimum test setup should look like for eva.

@BenjaminBossan thanks for all your suggestions, I integrated all of it into the pull request.
Regarding testing I added a new class TestEvaInitialization into tests_initialization.py. The tests basically run eva initialization three times for different seeds and check that the average cosine similarity between the same svd component from different seeds is above a certain threshold. I defined two three test cases. I fear doing a finetuning run or replicating one of the findings of the paper would probably take up too much resources / take to long for a testcase.

Check the get_eva_state_dict function which returns the state_dict for eva. We use a non-peft model because testing peft models is covered with the next test
Check initialize_lora_eva_weights with a LoRA model which internally also calls get_eva_state_dict
Check the __post_init__ method of EvaConfig for invalid settings.

During testing I noticed a potential issue with how the loftq_config field is defined in LoraConfig. I added an issue and could also create a separate pull request for it.

@BenjaminBossan I integrated all of your suggestions in the code, many thanks (for details I left comments to the separate conversations you opened about suggested changes).
Two general questions:

I included a gpu-dependent test in test_initialization with pytest.mark.skipif(not torch.cuda.is_available(), reason="test requires a GPU") to test bitsandbytes. Is that fine to have all EVA tests in one class in this script or would I need to move this test to test_common_gpu or test_gpu_examples?
under examples/eva_finetuning/README.md I added sections using the [[autotest]] command to automatically use the docstrings of the eva related functions. Is that fine or does that not work for the examples section?

Thank you again for your suggestions @BenjaminBossan, I worked them all into the pull request.

I moved the test for bits and bytes to test_gpu_examples.py. It was necessary to duplicated some code but I guess thats fine.
I updated the documentation a bit. I also added a section for eva under package reference, please let me know if its okay like this. I think it would be beneficial to find info about the EVA functions in the documentation.
Since my last message in this pull request I also made changes to the entrypoint get_indices_fn for customizing EVA. I made it a bit more generic and easier for users to understand. I renamed the callable argument in get_eva_state_dict and initialize_lora_eva_weights to prepare_model_inputs_fn now. It can be used to modify the model inputs and have access to the result in the SVD hooks. I adjusted the tests accordingly.
I discussed the topic about a default EvaConfig with my coauthors. Some parameters like rho or user_label_mask have a setting that should work well for most applications but nevertheless it can be important to adjust the default settings. We were wondering if we should initialize a default EvaConfig if its not specified but raise a warning explaining that it might be important to change the parameters in some cases. In either case I also updated the docstring of EvaConfig to mention this.

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@BenjaminBossan thanks for raising the issue with saving/loading eva models, didnt think about this at first. It should be fixed now. I am updating the rank_pattern in init_lora_eva_weights.
I also found another potential issue that was not accounted for so far. It is possible that after eva initialization some adapter layers could get assigned rank 0 . In those cases we would need to remove the adapter layer again. We would also need to update target_modules in the peft config. I also added test cases for this and the above issue. To test the rank=0 case it was necessary to move some functionality out of init_lora_eva_weights into a new function load_eva_state_dict. Otherwise it would not have been possible to modify the eva_state_dict (i.e. assigning one layer rank 0) in the test script. init_lora_eva_weights now just combines the two lower level functions get_eva_state_dict and load_eva_state_dict
Regarding alpha values, it should be fine as is for now. For the experiments in our paper we also did not adjust alpha for different ranks after the redistribution. I saw that the AdaLoRA implementation also did not adjust alpha for different ranks, is that right? We might look into this in the future.
Regarding docs, I built it locally and everything looks fine.

@BenjaminBossan thanks for your thoroughness, there were still some edgecases I didnt consider.
Besides the things you pointed out I updated some things additionally (sorry that there are still so many changes in the PR, but I keep discovering potential issues for users or ways to make the api simpler for users)

Fixed an issue in get_eva_state_dict if LoraConfig contains a rank pattern. For these cases max_components can be different for different layers so this variable is now a dict with keys being the adapter module names.
removed function load_eva_state_dict and integrated functionality into initialize_lora_eva_weights. This function now accepts an optional eva_state_dict argument.

One question: When loading the eva_state_dict I need to get the module name in the base model based off the module name in the peft model. I this a valid way to do that:
name_in_base_model = name.replace("base_model.model.", "")

@BenjaminBossan, thanks integrated you suggestions and left some comments to the open threads:

when calling update_layer is needed
unsupported or supported lora modules
None check for dataloader

@BenjaminBossan this is the dicussion about update_layer.
For the other two open conversation I added a comment directly to the conversation.

Great, thanks for your feedback, I made some small changes, I think the only open issue is the potential circular import constants.py.
Small note: I changed the default value of rho back to 1.0 as this works well in most settings.

@sirluk Some Eva tests are failing:
https://github.com/huggingface/peft/actions/runs/11698806717/job/32754904346?pr=2142#step:6:1195
Is it possible that you tested this with a GPU and there it's fast enough, but on the CPU CI runners, it's too slow? Maybe we should remove the timing assertions, as they tend to be flaky?

Thanks for pointing this out, I was indeed testing on a gpu machine so it was automatically running everything on gpu. I removed the speed test now.

Great, thanks for your great feedback throughout the process!

Great PR!

@sirluk I just wanted to make you aware of PR #2231 which introduces a (at least superficially) similar method to EVA, which also benefited from our discussion here to improve the API. The PR includes a small table that summarizes a couple of methods including EVA, maybe you can double check that it's accurate.

@BenjaminBossan, thanks for making us aware of this recent PR. It is indeed very relevant and interesting to us as well. I'm glad our discussion benefits the integration of other data-driven methods into PEFT. We believe the table is not entirely correct with respect to EVA. From their paper, "Knowledge Maintenance mode" in CorDA simply means using the smallest components for initialization, rather than the largest ones. This is necessary for methods like CorDA and PiSSA because they modify the base model weights, meaning the base model cannot be restored after fine-tuning. We intentionally followed the design of LoRA and left the base model untouched as this allows restoring the base model's weights and therefore full knowledge preservation. We just recently  added a discussion paragraph on that in the updated version of our paper which will be on arXiv soon.
(tagging @paischer101 as he is the other joint first-author of EVA)

@BenjaminBossan thanks for the response. Since EVA does not alter the base model weights, it is able to recover the base model and therefore allows full knowledge maintenance, i.e. the last column in the table should be a "yes" for EVA as well. I will make a post on the PR to clarify.

Hey @BenjaminBossan , just wanted to let you know there is a mistake in the latest peft release notes describing EVA. It says that we use "SVD of the base layer weights" which is not correct. EVA is a data driven method that performs incremental SVD on minibatches of finetuning data. The result is used to initilize LoRA and perform an adaptive rank redistribution. Could you maybe change that so that potential users are not confused?

@sirluk Thanks for notifying us. I changed the release text accordingly.