Skip to content

Releases: IBM/unitxt

1.15.10

09 Dec 13:34
74a9ad8
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.15.9...1.15.10

Unitxt 1.15.9

01 Dec 13:00
22d1fff
Compare
Choose a tag to compare

Main changes

image

What's Changed

Full Changelog: 1.15.8...1.15.9

Unitxt 1.15.8

26 Nov 15:05
70e9908
Compare
Choose a tag to compare

Main changes

Added support for RITS Inference Engine

Inference Engines

Assets

Bug Fixes

Full Changelog: 1.15.7...1.15.8

1.15.7

22 Nov 18:06
db339b6
Compare
Choose a tag to compare

Assets

Usability

Bug fixes

Documentation

Inference Engine

  • Tests and minor changes Changes to GenAI, WML and HF inference engines by @pawelknes in #1290

Full Changelog: 1.15.6...1.15.7

Unitxt 1.15.6 - Chat Inference

19 Nov 21:44
d5a43fc
Compare
Choose a tag to compare

Main changes

  • Added support for generating output in ChatAPI format (user/assistant turns) and for inference engines to process ChatAPI input.
    See details in blog.

  • Improved catalog browsing experience with cleaner formatting of catalog assets, and clickable hyper links between catalog assets and between catalog assets and code. See for example.

New Features

Inference Engines that support ChatApi interface

Improved multi model support

New Asserts

Performance

Usuability

Documentation

CI/CD

New Contributors

Full Changelog: 1.14.1...1.15.6

Unitxt 1.14.1 - Faster Unitxt 🚀

27 Oct 11:49
3adcc54
Compare
Choose a tag to compare

Important Change: Unitxt is Faster!

To improve Unitxt’s performance, we've made several optimizations:

  1. Operator Acceleration: Many operators have been sped up by removing unnecessary deep copying in their code, enhancing runtime efficiency.

  2. Caching Hugging Face Datasets: We added the option to cache Hugging Face datasets in loaders, which can prevent redundant loading operations. To enable this, you can either:

    • Set it globally in code:
      import unitxt
      
      unitxt.settings.disable_hf_datasets_cache = False
    • Use the settings context:
      with settings.context(disable_hf_datasets_cache=False):
          # your code
    • Or set the environment variable:
      export UNITXT_DISABLE_HF_DATASETS_CACHE=False
  3. Eager Execution Mode: Running Unitxt without streaming, which can be faster in certain scenarios. Enable eager execution using the environment variable or directly in code:

    unitxt.settings.use_eager_execution = True
    # or
    with settings.context(use_eager_execution=True):
        # your code
  4. Partial Stream Loading: This feature lets you load only the necessary data instances, avoiding full dataset loads when not required. Here's an example:

    from unitxt import load_dataset
    
    dataset = load_dataset(
        card="cards.doc_vqa.lmms_eval",
        template="templates.qa.with_context.title",
        format="formats.models.llava_interleave",
        loader_limit=300,
        streaming=True,
    )
    print(next(iter(dataset["test"][0])))  # Loads only the first instance

    Complete Example: Combining the optimizations above can lead to near 1000x faster dataset loading:

    from unitxt import load_dataset, settings
    
    with settings.context(
        disable_hf_datasets_cache=False,
        use_eager_execution=True,
    ):
        dataset = load_dataset(
            card="cards.doc_vqa.lmms_eval",
            template="templates.qa.with_context.title",
            format="formats.models.llava_interleave",
            loader_limit=300,
            streaming=True,
        )
        print(next(iter(dataset["test"][0])))  # Loads only the first instance
  5. Execution Speed Tracking: A GitHub action has been added to monitor Unitxt’s execution speed in new pull requests, helping ensure that optimizations are maintained.


Summary

This release is focused on accelerating performance in Unitxt by introducing several key optimizations. Operator efficiency has been enhanced by removing deep copies, making operations faster. Users can now enable dataset caching for Hugging Face datasets to prevent redundant loading, configured directly in code or through environment variables. An optional eager execution mode has been added, bypassing streaming to increase speed in certain scenarios. Additionally, partial stream loading allows selective instance loading, reducing memory usage and improving response times. To maintain these improvements, a new GitHub action now monitors Unitxt’s execution speed in pull requests, ensuring consistent performance across updates.

All Changes

New Contributors

Full Changelog: 1.13.1...1.14.1

Unitxt 1.14.0 - Faster Unitxt

20 Oct 11:55
3d027e9
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.13.0...1.14.0

Unitxt 1.13.1

30 Sep 07:05
d1219c9
Compare
Choose a tag to compare
Update version to 1.13.1 (#1244)

Unitxt 1.13.0

25 Sep 06:37
80b284f
Compare
Choose a tag to compare

Unitxt 1.13.0 - Multi Modality and Types

New type handling capabilities

The most significant change in this release is the introduction of type serializers to unitxt.
Type serializers in charge of taking a specific type of data structure such as Table, or Dialog and serialize it to textual representation.
Now you can define tasks in unitxt that have complex types such as Table or Dialog and define serializers that handle their transformation to text.

This allows to control the representation of different types from the recipe api:

from unitxt import load_dataset
from unitxt.struct_data_operators import SerializeTableAsMarkdown

serializer = SerializeTableAsMarkdown(shuffle_rows=True, seed=0)
dataset = load_dataset(card="cards.wikitq", template_card_index=0, serializer=serializer)

And if you want to serialize this table differently you can change any of the many available table serializers.

Defining New Type

If you wish to define a new type with custom serializers you can do so by using python typing library:

from typing import Any, List, TypedDict

class Table(TypedDict):
    header: List[str]
    rows: List[List[Any]]

Once your type is ready you should register it to unitxt type handling within the code you are running:

from unitxt.type_utils import register_type

register_type(Table)

Now your type can be used anywhere across unitxt (e.g in task definition or serializers).

Defining a Serializer For a Type

If you want to define a serializer for your custom type or any typing type combination you can do so by:

class MySerizlizer(SingleTypeSerializer):
    serialized_type = Table
    def serialize(self, value: Table, instance: Dict[str, Any]) -> str:
        # your code to turn value of type Table to string

Multi-Modality

You now can process Image-Text to Text or Image-Audio to Text datasets in unitxt.
For example if you want to load the doc-vqa dataset you can do so by:

from unitxt import load_dataset

dataset = load_dataset(
    card="cards.doc_vqa.en",
    template="templates.qa.with_context.title",
    format="formats.models.llava_interleave",
    loader_limit=20,
)

Since we have data augmentation mechanisms it is just natural to use it for images. For example if you want your images in grey scale:

dataset = load_dataset(
    card="cards.doc_vqa.en",
    template="templates.qa.with_context.title",
    format="formats.models.llava_interleave",
    loader_limit=20,
    augmentor="augmentors.image.grey_scale", # <= Just like the text augmenters!
)

Then if you want to get the scores of a model on this dataset you can use:

from unitxt.inference import HFLlavaInferenceEngine
from unitxt.text_utils import print_dict
from unitxt import evaluate

inference_model = HFLlavaInferenceEngine(
    model_name="llava-hf/llava-interleave-qwen-0.5b-hf", max_new_tokens=32
)

test_dataset = dataset["test"].select(range(5))

predictions = inference_model.infer(test_dataset)
evaluated_dataset = evaluate(predictions=predictions, data=test_dataset)

print_dict(
    evaluated_dataset[0],
    keys_to_print=["source", "media", "references", "processed_prediction", "score"],
)

Multi modality support in unitxt is building upon the type handling introduced in the previous section with two new types: Image and Audio.

What's Changed

New Contributors

Full Changelog: 1.12.4...1.13.0

1.12.4

28 Aug 13:17
1a97cce
Compare
Choose a tag to compare

Main changes

Additions to catalog

New Features

  • Add LLM as judge ensemble metrics, and add LLMaaJ ensemble example by @pvn25 in #1081
  • Refactor RenameFields operator to Rename. The old operator is still supported but raises a deprecation warning by @elronbandel in #1123

Bug Fixes

Documentation changes

  • Update llm_as_judge.py --- copy edits (grammar, consistency, clarity) by @welisheva22 in #1164
  • Update formats.py --- copy edits (grammar, consistency, clarity) by @welisheva22 in #1163
  • Update loaders.py --- copy edits (grammar, consistency, clarity) by @welisheva22 in #1162
  • Update card.py - minor documentation changes by @welisheva22 in #1161
  • Update adding_dataset.rst - a few more minor documentation changes by @welisheva22 in #1160
  • Update artifact.py --- documentation edits (grammar, consistency, cla… by @welisheva22 in #1159
  • Update glossary.rst --- copy edits (grammar, consistency, clarity) by @welisheva22 in #1155
  • Update helm.rst --- copy edits (grammar, consistency, clarity) by @welisheva22 in #1154
  • Update operators.py --- copy edits (grammar, consistency, clarity) - take 2 by @welisheva22 in #1158
  • Docfix: Fix typo in Installation doc by @yifanmai in #1181

New Contributors