Skip to content

Converts texts given as a single str to list#288

Merged
Ingvarstep merged 1 commit into
urchade:mainfrom
jackboyla:main
Aug 16, 2025
Merged

Converts texts given as a single str to list#288
Ingvarstep merged 1 commit into
urchade:mainfrom
jackboyla:main

Conversation

@jackboyla

Copy link
Copy Markdown
Contributor

Nice work on GLiNER decoder! I was just trying it out but noticed that the example passes text as a string:

from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/gliner-decoder-large-v1.0")

text = (
    "Apple was founded as Apple Computer Company on April 1, 1976, "
    "by Steve Wozniak, Steve Jobs (1955–2011) and Ronald Wayne to "
    "develop and sell Wozniak's Apple I personal computer."
)

labels = ["person", "other"]

model.run(text, labels, threshold=0.3, num_gen_sequences=1)

This results in the string being split into characters. I just added a check to see if texts is a string and if so, convert it to a list.

@Ingvarstep Ingvarstep merged commit 479cb08 into urchade:main Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants