-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implement precision_score function and test aligned with sklearn metrics #28407
Merged
Commits on Sep 4, 2023
-
func_wrapper.py is a Python module designed to streamline the integration of Hugging Face Transformers into your natural language processing (NLP) projects. It provides a set of input and output conversion wrappers to simplify the process of passing data between your custom functions and Transformers' data structures. Input Conversion Wrappers: inputs_to_transformers_tensors: This wrapper converts input data (text, tensors, etc.) into Transformers-compatible data structures. It is particularly useful when your custom functions expect diverse input types. Output Conversion Wrappers: outputs_to_pytorch_tensors: After your custom function returns data, this wrapper ensures that the output data is converted into PyTorch tensors or other appropriate formats. Usage: Import func_wrapper.py into your project. Initialize a Hugging Face Transformers model and tokenizer. Wrap your custom function with to_transformers_tensors_and_back. This wrapped function can now accept and return Transformers-compatible data. Here's a simple example of how to use func_wrapper.py: import torch from transformers import BertForSequenceClassification, BertTokenizer from iivy.functional.frontends.transformers.func_wrapper import to_transformers_tensors_and_back # Initialize the model and tokenizer model_name = "bert-base-uncased" model = BertForSequenceClassification.from_pretrained(model_name) tokenizer = BertTokenizer.from_pretrained(model_name) # Wrap your custom function using the conversion wrappers wrapped_function = to_transformers_tensors_and_back(your_function, model, tokenizer) # Prepare sample input data sample_input_text = "This is a sample input text." sample_input_tensor = torch.rand((3, 3)) # Call your wrapped function with the sample input data output = wrapped_function(sample_input_text, sample_input_tensor) # The output is automatically converted to PyTorch tensors print(output) Please note that func_wrapper.py is still in development, and further enhancements and refinements are expected. Your feedback and contributions to improve its functionality are welcome.
Configuration menu - View commit details
-
Copy full SHA for 54e5e6f - Browse repository at this point
Copy the full SHA 54e5e6fView commit details
Commits on Feb 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8a9de57 - Browse repository at this point
Copy the full SHA 8a9de57View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce7067e - Browse repository at this point
Copy the full SHA ce7067eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81ecd3f - Browse repository at this point
Copy the full SHA 81ecd3fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ac9e299 - Browse repository at this point
Copy the full SHA ac9e299View commit details -
Configuration menu - View commit details
-
Copy full SHA for d4dfe4d - Browse repository at this point
Copy the full SHA d4dfe4dView commit details
Commits on Feb 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for a8cffef - Browse repository at this point
Copy the full SHA a8cffefView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fc6caf - Browse repository at this point
Copy the full SHA 5fc6cafView commit details
Commits on Feb 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 66ad054 - Browse repository at this point
Copy the full SHA 66ad054View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ddbe54 - Browse repository at this point
Copy the full SHA 7ddbe54View commit details -
Configuration menu - View commit details
-
Copy full SHA for 99482a2 - Browse repository at this point
Copy the full SHA 99482a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0480200 - Browse repository at this point
Copy the full SHA 0480200View commit details -
Updated dtypes in test_classification.py
for sklearn_metrics precision_score and recall score
Configuration menu - View commit details
-
Copy full SHA for ad4fa46 - Browse repository at this point
Copy the full SHA ad4fa46View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2acd5f - Browse repository at this point
Copy the full SHA d2acd5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for f904b6e - Browse repository at this point
Copy the full SHA f904b6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d4be9f4 - Browse repository at this point
Copy the full SHA d4be9f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 02ed1df - Browse repository at this point
Copy the full SHA 02ed1dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0bb503c - Browse repository at this point
Copy the full SHA 0bb503cView commit details -
Configuration menu - View commit details
-
Copy full SHA for b1d4d9f - Browse repository at this point
Copy the full SHA b1d4d9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 22c6c68 - Browse repository at this point
Copy the full SHA 22c6c68View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd9198f - Browse repository at this point
Copy the full SHA fd9198fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 80fe8b3 - Browse repository at this point
Copy the full SHA 80fe8b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b2ee9d - Browse repository at this point
Copy the full SHA 4b2ee9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for fef2396 - Browse repository at this point
Copy the full SHA fef2396View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d583b3 - Browse repository at this point
Copy the full SHA 9d583b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e3c701 - Browse repository at this point
Copy the full SHA 9e3c701View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fc8174 - Browse repository at this point
Copy the full SHA 5fc8174View commit details -
Configuration menu - View commit details
-
Copy full SHA for e8cb8d1 - Browse repository at this point
Copy the full SHA e8cb8d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 46336db - Browse repository at this point
Copy the full SHA 46336dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1033828 - Browse repository at this point
Copy the full SHA 1033828View commit details -
Configuration menu - View commit details
-
Copy full SHA for 54a4853 - Browse repository at this point
Copy the full SHA 54a4853View commit details -
Configuration menu - View commit details
-
Copy full SHA for cff01e9 - Browse repository at this point
Copy the full SHA cff01e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d3a8d6 - Browse repository at this point
Copy the full SHA 5d3a8d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9fe0c06 - Browse repository at this point
Copy the full SHA 9fe0c06View commit details -
Configuration menu - View commit details
-
Copy full SHA for f790e91 - Browse repository at this point
Copy the full SHA f790e91View commit details -
Configuration menu - View commit details
-
Copy full SHA for db753fb - Browse repository at this point
Copy the full SHA db753fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 72a1a70 - Browse repository at this point
Copy the full SHA 72a1a70View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ffa551 - Browse repository at this point
Copy the full SHA 1ffa551View commit details -
Configuration menu - View commit details
-
Copy full SHA for 69bdae8 - Browse repository at this point
Copy the full SHA 69bdae8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 02095c1 - Browse repository at this point
Copy the full SHA 02095c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9bba1d0 - Browse repository at this point
Copy the full SHA 9bba1d0View commit details
Commits on Feb 28, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 128c86c - Browse repository at this point
Copy the full SHA 128c86cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 20493de - Browse repository at this point
Copy the full SHA 20493deView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a7efde - Browse repository at this point
Copy the full SHA 9a7efdeView commit details -
Configuration menu - View commit details
-
Copy full SHA for ad640d1 - Browse repository at this point
Copy the full SHA ad640d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 964ca7b - Browse repository at this point
Copy the full SHA 964ca7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e4afd6e - Browse repository at this point
Copy the full SHA e4afd6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for c59b930 - Browse repository at this point
Copy the full SHA c59b930View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe0887e - Browse repository at this point
Copy the full SHA fe0887eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c2a268 - Browse repository at this point
Copy the full SHA 9c2a268View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7575a01 - Browse repository at this point
Copy the full SHA 7575a01View commit details -
Configuration menu - View commit details
-
Copy full SHA for d7956f4 - Browse repository at this point
Copy the full SHA d7956f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52862bf - Browse repository at this point
Copy the full SHA 52862bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b6db54 - Browse repository at this point
Copy the full SHA 1b6db54View commit details -
Configuration menu - View commit details
-
Copy full SHA for 423d5a7 - Browse repository at this point
Copy the full SHA 423d5a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9fb4a4 - Browse repository at this point
Copy the full SHA a9fb4a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b79f79 - Browse repository at this point
Copy the full SHA 6b79f79View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22aebd2 - Browse repository at this point
Copy the full SHA 22aebd2View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab7d4ed - Browse repository at this point
Copy the full SHA ab7d4edView commit details -
Configuration menu - View commit details
-
Copy full SHA for 209e882 - Browse repository at this point
Copy the full SHA 209e882View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc1ae81 - Browse repository at this point
Copy the full SHA bc1ae81View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f9271d - Browse repository at this point
Copy the full SHA 1f9271dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f559edb - Browse repository at this point
Copy the full SHA f559edbView commit details -
Configuration menu - View commit details
-
Copy full SHA for ea488cd - Browse repository at this point
Copy the full SHA ea488cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 68f85d1 - Browse repository at this point
Copy the full SHA 68f85d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 19dd4d8 - Browse repository at this point
Copy the full SHA 19dd4d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13aa09b - Browse repository at this point
Copy the full SHA 13aa09bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8843022 - Browse repository at this point
Copy the full SHA 8843022View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.