Skip to content

How to change encoder backbone when training #262

Open

Description

@ngocnd2402

I wanna finetune the gliner on another encoder (for e.g, visobert) using gliner library, may someone guide me with this, many thanks!

Activity

  1. P0L3 commented on Jun 8, 2026

    @P0L3

    This might be helpful.

  2. urchade commented on Jun 8, 2026

    @urchade
    Owner

    You can instantiate a model like this:

    from gliner import GLiNER
    
    model_cfg = {
        "model_name": "answerdotai/ModernBERT-base",  # change to your encoder
        "name": "my model",
        "max_width": 12,
        "hidden_size": 768,
        "dropout": 0.3,
        "fine_tune": True,
        "subtoken_pooling": "first",
        "span_mode": "markerV0",
        "max_types": 100,
        "max_len": 512,
    }
    
    model = GLiNER.from_config(model_cfg)

    @ngocnd2402

  3. ngocnd2402 commented on Jun 9, 2026

    @ngocnd2402
    Author

    Thanks a lot

  4. added
    question
    on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions