---
base_model: sentence-transformers/all-mpnet-base-v2
library_name: setfit
metrics:
- accuracy
pipeline_tag: text-classification
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: "Bug: Radio button onChange not called in current React Canary \r\n\r\nReact version:\
\ 18.3.0-canary-a1f97589f-20230526\r\n\r\n\r\n## Steps To Reproduce\r\n\r\n1.\
\ Create radio buttons that toggle `disabled` in `onChange`\r\n2. After selecting\
\ each radio button, `onChange` is no longer called\r\n\r\n\r\n\r\nLink to\
\ code example:\r\n\r\nThe following CodeSandbox demonstrates the issue with the\
\ current react canary version. The issue is not present when react & react-dom\
\ versions are changed to stable 18.2.0\r\n\r\nhttps://codesandbox.io/s/react-canary-radio-buttons-deiqb3?file=/src/App.js\r\
\n\r\n\r\
\n\r\n## The current behavior\r\n``'s `onChange` prop\
\ is not called on subsequent clicks of the input\r\n\r\n## The expected behavior\r\
\n``'s `onChange` prop should be called on subsequent\
\ clicks of the input\r\n"
- text: "Allow opting out of invokeGuardedCallbackDev At the moment, when in development\
\ mode, React uses a special workflow for callbacks, to avoid using `try...catch`.\r\
\n\r\nIt works well. So well that several testing frameworks also get their uncaught\
\ exception handling triggered.\r\n\r\n**Example with mocha:**\r\n```js\r\nimport\
\ React from 'react';\r\nimport { render } from '@testing-library/react';\r\n\r\
\nfunction MyComponent({ doThrow }) {\r\n if (doThrow) { throw new Error('I'm\
\ bad'); }\r\n return
;\r\n}\r\n\r\nit('should throw', function\
\ () {\r\n expect(() => {\r\n render();\r\n \
\ }).to.throw();\r\n});\r\n```\r\n**Behavior:**\r\n- When running the test with\
\ the production build of react/react-dom, the test passes (with the usual warning\
\ of act being unsupported in prod build).\r\n- When running the test with the\
\ development build of react-/react-dom, the test fails with `Error: Uncaught\
\ Error: I'm bad`.\r\n\r\nThe root cause is `invokeGuardedCallbackDev` runs the\
\ callback in an event to avoid using a `try...catch` block… and trips Mocha.js\
\ uncaught exception detector.\r\n\r\n*Note: I am aware of error boundaries, I\
\ removed it from the example because the behavior is identical with it.*\r\n\r\
\n*Note: I used testing-library for clarity, but using `act` and `RenderDOM` manually\
\ yields the same result.*\r\n\r\n**Expected behavior:**\r\n- Either make it work\
\ out of the box, or have the possibility to opt out of `invokeGuardedCallbackDev`\
\ and force the use of the regular `try...catch` implementation in development\
\ too.\r\n"
- text: "Setting rendering mode to component of react-art \r\n\r\n**Do you want\
\ to request a *feature* or report a *bug*?**\r\nfeature\r\n\r\n**What is the\
\ current behavior?**\r\n`` of canvas mode and `` of svg mode\
\ cannot be used in a document at the same time.\r\n\r\n**What is the expected\
\ behavior?**\r\nTwo more `` components with each other modes can be\
\ used in a document at the same time.\r\n\r\n\r\nCurrently developers can set\
\ only one rending mode globally in react-art, using `setCurrent()` of `art/modes/current`\
\ module. So there is no way to use `` of canvas mode and ``\
\ of svg mode in a document together. On the other hand, `art.js` internally used\
\ in `react-art` provides a way to use each other modes together as directly importing\
\ their corresponding modules. (e.g. svg.js for svg mode, canvas.js for canvas\
\ mode in `art.js` lib). \r\n\r\nI would like to suggest a way to set own rendering\
\ mode per instance of `` Component by new property `mode`. This feature\
\ makes `` with canvas mode and `` with svg mode to be used\
\ together in a document like the following.\r\n\r\n```javascript\r\nconst {\r\
\n Surface,\r\n Group,\r\n Shape\r\n} = require('react-art');\r\n\r\nclass\
\ TestComponent extends React.Component {\r\n render() {\r\n return (\r\n\
\ \r\n \r\
\n \r\n \r\n \
\ \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\
\ );\r\n }\r\n};\r\n```\r\n\r\nIf `mode` property is not set, ``\
\ works as canvas mode for compatibility.\r\n\r\nI have made a PR for this feature\
\ to show how to work and use it ([#13249](https://github.com/facebook/react/pull/13249)).\r\
\nAnd you can check this feature through `art` fixture of my PR.\r\n\r\nFeel free\
\ to discuss about this feature.\r\n\r\n\r\n\r\n"
- text: "[DevTools Bug]: Firefox and Edge show error in console about unrecognized\
\ installation on v4.20.0 ### Website or app\r\n\r\nreactjs.org\r\n\r\n### Repro\
\ steps\r\n\r\n1. Install React DevTools v4.20.0 in Firefox\r\n2. Load reactjs.org\
\ in Firefox\r\n3. Open Firefox DevTools\r\n4. Observe error in console\r\n\r\n\
\r\
\n\r\n\r\n### How often does this bug happen?\r\n\r\nEvery time\r\n"
- text: "componentWillUpdate discussion \r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n\r\n\
Feature : componentWillUpdate Discussion\r\n\r\n**What is the current behavior?**\r\
\n\r\nThe current behavior calls the function before re-rendering the render target\
\ however there is no indication for when the re-render method should be called\r\
\n\r\n**If the current behavior is a bug, please provide the steps to reproduce\
\ and if possible a minimal demo of the problem. Your bug will get fixed much\
\ faster if we can run your code and it doesn't have dependencies other than React.\
\ Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox\
\ (https://codesandbox.io/s/new) example below:**\r\n\r\n**What is the expected\
\ behavior?**\r\n\r\nThe expected behavior should call the function before re-rendering\
\ the render target if there is no returned conditional statement and if there\
\ is, true should trigger the re-render and false should not\r\n\r\n**Which versions\
\ of React, and which browser / OS are affected by this issue? Did this work in\
\ previous versions of React?**\r\n\r\n16.4.0\r\n\r\nI have a few questions before\
\ I try to solve this problem and it gets rejected. I'm assuming that the team\
\ has decided to move in the direction of removing \"Will-Updates\" from React\
\ all together and have labeled them \"Unsafe\". I've seen a lot of issues with\
\ those functionalities before as well. I was curious if providing a conditional\
\ statement inside those functions would satisfy the unexpected renders. \"shouldComponentUpdate\"\
\ does trigger when to call these functions however in those functions that \"\
will\" run before the render can always be controlled with a conditional statement\
\ of it's own. I'm getting comfortable with the code base however I'm curious\
\ if the team is removing that functionality all together and using the \"static\"\
\ function \"getDerivedStateFromProps\" instead. Has a React lover it is a little\
\ confusing and may break a lot of legacy code when updating versions. I believe\
\ that may solve the problem of unexpected renders after a \"will\" change lifecycle\
\ event.\r\n\r\nI was curious if that was the case, and removing \"will\" lifecycles\
\ is the next steps for React then how will the \"did\" lifecycles work instead?\r\
\n\r\nI love React and I'm just curious about the future for React as a whole.\
\ I'd love to tackle any bugs or feature requests when I have time. I will be\
\ writing clean code and create tests for new features or bugs as well."
inference: true
---
# SetFit with sentence-transformers/all-mpnet-base-v2
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification.
The model has been trained using an efficient few-shot learning technique that involves:
1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
2. Training a classification head with features from the fine-tuned Sentence Transformer.
## Model Details
### Model Description
- **Model Type:** SetFit
- **Sentence Transformer body:** [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2)
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
- **Maximum Sequence Length:** 384 tokens
- **Number of Classes:** 3 classes
### Model Sources
- **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
### Model Labels
| Label | Examples |
|:---------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| feature |
"Provide a `testInstance.context` property to facilitate context testing \r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\nFeature Request\r\n\r\n**What is the current behavior?**\r\n`testInstance` provides a `props` property, but does not provide a `context` property allowing for context tests.\r\n\r\n**What is the expected behavior?**\r\n`testInstance.context` should return an object containing the instance's current context\r\n\r\n**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**\r\nAt least 16.4.1"
'Cursor jumps to end of input when onChange doesn\'t call setState [Edit]: **I\'m asking for a feature**.\r\n\r\n**Current Behaviour**\r\nAn input `onChange` function that returns a value equalling the prior value causes the cursor to jump to the end of the input. This is the same as [this comment from #995](https://github.com/facebook/react/issues/955#issuecomment-327069204) formally raised as a feature request. \r\n\r\nRepro sandbox: https://codesandbox.io/s/n4k3yx47j\r\nThat same code: \r\n```javascript\r\nimport React from "react";\r\nimport { render } from "react-dom";\r\n\r\nclass Input extends React.Component {\r\n state = { value: "TypeANumber" };\r\n\r\n onChange = e => {\r\n let nextValue = e.target.value;\r\n\r\n if (/[0-9]/.test(nextValue)) {\r\n nextValue = this.state.value;\r\n }\r\n this.setState({ value: nextValue });\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nrender(, document.getElementById("root"));\r\n```\r\n\r\n**What is the expected behavior?**\r\nI\'d like the cursor not to jump in the special case where the returned changed value is a rejected change i.e. the \'noop\' change. \r\n\r\nI understand fully that react cannot predict cursor position if the value is _changed_ in `onChange`, ~however I cannot currently find an npm module that allows free-length regex filters (vs a fixed length mask)~ or a way to implement a filter myself, without the cursor jumping in this case. \r\n\r\n[Edit]: \r\nSince raising I now fully see this as a feature request for handling a special case of a behaviour that indeed is not a bug, differently. It would be a nice to have as it would allow very straightforward implementation of filters. \r\n\r\nRegarding the non-clarity of how to deal with the general case of non-jumping cursors I think a modernized best practice example would be ideal, but that discussion still lives at #955. \r\n\r\nI\'d be totally fine with this issue being closed by assisting instead with the education of handling the general case. Though, this would still be a nice to have for the API, if possible. \r\n'
'Allow ReactNode as a type for the child of **Do you want to request a *feature* or report a *bug*?**\r\nFeature\r\n\r\n**What is the current behavior?**\r\nCurrently, the options element only allows types number and string. \r\n\r\n**What is the expected behavior?**\r\nAn option should allow for a ReactNode as a child in addition to a number + string. \r\n\r\n**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**\r\nAll versions.\r\nAll browser types.\r\nTo the best of my knowledge, no.\r\n\r\np.s. This is my first feature request here, so let me know if I need to adjust the feature request in any way. '
|
| bug |
' ERROR TypeError: Cannot read property \'createElement\' of undefined, js engine: hermes ### App\r\n\r\nusing flipper dor react devtools\r\n\r\n### Repro steps\r\n\r\nmigrate to current version of RN-0.71.1\r\nusing flipper \r\nenable hermes engine\r\nrun the app\r\n\r\n\r\n\r\n\r\n### How often does this bug happen?\r\n\r\nEvery time\r\n\r\n### DevTools package (automated)\r\n\r\n_No response_\r\n\r\n### DevTools version (automated)\r\n\r\n_No response_\r\n\r\n### Error message (automated)\r\n\r\nERROR TypeError: Cannot read property \'createElement\' of undefined, js engine: hermes \r\n\r\n### Error call stack (automated)\r\n\r\n```text\r\nERROR TypeError: Cannot read property \'createElement\' of undefined, js engine: hermes \r\n\r\nthis is related to --->> path: node_modules/react-devtools-core/dist/backend.js\r\nfunction initialize() {\r\n canvas = window.document.createElement(\'canvas\');\r\n canvas.style.cssText = "\\\\n xx-background-color: red;\\\\n xx-opacity: 0.5;\\\\n bottom: 0;\\\\n left: 0;\\\\n pointer-events: none;\\\\n position: fixed;\\\\n right: 0;\\\\n top: 0;\\\\n z-index: 1000000000;\\\\n ";\r\n var root = window.document.documentElement;\r\n root.insertBefore(canvas, root.firstChild);\r\n}\r\n```\r\n\r\n\r\n### Error component stack (automated)\r\n\r\n_No response_\r\n\r\n### GitHub query string (automated)\r\n\r\n_No response_'
'[DevTools Bug] Cannot remove node "0" because no matching node was found in the Store. ### Website or app\n\nReact Native App\n\n### Repro steps\n\n1. Run react native app\r\n2. npx react-devtools\r\n3. adb reverse tcp:8097 tcp:8097\r\n4. reload the app, this error should come as mentioned below\n\n### How often does this bug happen?\n\nEvery time\n\n### DevTools package (automated)\n\nreact-devtools-core\n\n### DevTools version (automated)\n\n4.24.7-7f673317f\n\n### Error message (automated)\n\nCannot remove node "0" because no matching node was found in the Store.\n\n### Error call stack (automated)\n\n```text\nat /Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:333971\r\n at f.emit (/Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:279464)\r\n at /Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:281005\r\n at /Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:667650\r\n at Array.forEach ()\r\n at A.e.onmessage (/Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:48:667634)\r\n at A.t (/Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:39:2838)\r\n at A.emit (events.js:315:20)\r\n at e.exports.L (/Users/300037427/.npm/_npx/64332/lib/node_modules/react-devtools/node_modules/react-devtools-core/dist/standalone.js:3:58322)\r\n at e.exports.emit (events.js:315:20)\n```\n\n\n### Error component stack (automated)\n\n_No response_\n\n### GitHub query string (automated)\n\n```text\nhttps://api.github.com/search/issues?q=Cannot remove node because no matching node was found in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react\n```\n'
'[DevTools Bug] Cannot add node "1" because a node with that id is already in the Store. ### Website or app\r\n\r\nhttps://pasteboard.co/6Ec3lSzDE4Yz.png\r\n\r\n### Repro steps\r\n\r\n1. Open Chrome with 50+ tabs.\r\n2. Run React-based website locally.\r\n3. Open Chrome Dev Tools to investigate [ActiveLink component](https://pasteboard.co/6Ec3lSzDE4Yz.png) hierarchy inside [Navbar component](https://pasteboard.co/ab8kgmDNgn1I.png). \r\n4. ActiveLink component from [Next](https://github.com/vercel/next.js/tree/canary/examples/active-class-name) was used.\r\n5. Get uncaught error [Screenshot](https://pasteboard.co/3ugPX34TF2Xr.png)\r\n\r\n### How often does this bug happen?\r\n\r\nSometimes\r\n\r\n### DevTools package (automated)\r\n\r\nreact-devtools-extensions\r\n\r\n### DevTools version (automated)\r\n\r\n4.21.0-2f8f60ca8\r\n\r\n### Error message (automated)\r\n\r\nCannot add node "1" because a node with that id is already in the Store.\r\n\r\n### Error call stack (automated)\r\n\r\n```text\r\nat chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:26134:41\r\n at bridge_Bridge.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:24349:22)\r\n at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:24509:12\r\n at listener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:53230:39)\r\n```\r\n\r\n\r\n### Error component stack (automated)\r\n\r\n_No response_\r\n\r\n### GitHub query string (automated)\r\n\r\n```text\r\nhttps://api.github.com/search/issues?q=Cannot add node because a node with that id is already in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react\r\n```\r\n'
|
| question |
'DevTools component filter does not work with location **Do you want to request a *feature* or report a *bug*?**\r\nReport a bug.\r\n\r\n**What is the current behavior?**\r\nIn DevTools when a component filter is added with field set to `location` and regex set to `.*`, nothing is filtered out. (BTW, no documentation in this subject is available anywhere.)\r\n\r\n**What is the expected behavior?**\r\nAt least some components be filtered out.\r\nIt would also be awesome if the `location` was shown somewhere for the selected component, so that users can know what kind of Regex they should put together.\r\n\r\n**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**\r\nReact DevTools 4.2.0 on Firefox 69.0.3.'
'× Maximum update depth exceeded in controled way **Do you want to request a *feature* or report a *bug*?**\r\n- maybe bug?\r\n\r\n**What is the current behavior?**\r\n\r\nMy case is that I want to update state n times by adding different types of fields to the state and then render them. \r\nEvery updating of dom(adding new field) I have to check whether I should do something more by checking the hight of added elements, for example, add a break between elements. \r\nFields are represented by the tree structure of data, so I created the class which helps me with going through the tree of fields and I keep it in the class property.\r\n\r\nI know how many times I have to modify the DOM so It will be a fully controlled way of state update and it will finish after all fields are added to DOM but before I render all fields I am getting the error "Maximum update depth exceeded".\r\n\r\nDo you know How I can handle with such a problem? \r\nI found a solution by adding setTimeout on the way but I am not sure that is the clean solution?(commented code)\r\nIs it ok that I keep in component class property more complex class to manage structure of data?\r\n\r\nI am providing a simple example in codepage which shows the problem and throw the error.\r\n\r\nhttps://codesandbox.io/s/93w2lp37xw\r\n'
'Bug: Nested setState and unstable_batchedUpdates (are they ignored?) Nested setState and unstable_batchedUpdates (are them ignored?)\r\n\r\nReact version: 16.12\r\n\r\n## Steps To Reproduce\r\nhttps://codesandbox.io/s/batchedupdates-uselayouteffect-evj8s\r\n\r\nopen profile after click, you will see 3 commit.\r\n\r\nit seems that even if we use unstable_batchedUpdates, nested setStates called on\r\ndidUpdate/layouteffect do not get batched.\r\n'