-
Notifications
You must be signed in to change notification settings - Fork 126
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
Florence finetunes in workflows #794
Conversation
inference/core/workflows/core_steps/models/foundation/florence2/v1.py
Outdated
Show resolved
Hide resolved
|
||
class V2BlockManifest(BaseManifest): | ||
type: Literal["roboflow_core/florence_2@v2"] | ||
model_id: Union[WorkflowParameterSelector(kind=[ROBOFLOW_MODEL_ID_KIND]), str] = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in UI we do not display multiple versions of the same block treating newer versions as the ones shipping super-set of features - in this case (if I understand correctly) - you either choose pre-trained model (v1
) or fine-tuned one (v2
) - which needs to change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v2 can use the pre-trained ones by passing florence-2-base
or florence-2-large
as the model_id (same as before)! This is analogous to yolov8n-640 for object detection. This should show up in the model selector pop up but isn't -- we tried to do this in the frontend similar to yolov8n-640 or whatever, but its not working right now. Will look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the field is pre populated with the right pretrained value so ppl should not see a difference unless they try
…erence into florence-2-fts-in-workflows
@PawelPeczek-Roboflow good to go? |
Description
A few notable changes to florence models:
unstructured
, to allow the user to type whatever they want as a promptno_repeat_ngram_size=0
to our transformers generation argsWhy we set
no_repeat_ngram_size=0
:I found a very sneaky bug destroying the ability of the model to generate valid json, where this parameter was set to 3. Having the parameter set to 3 means that once the model has seen a sequence of 3 tokens, it can never repeat that sequence.
Here's the generation for a receipt json before and after making this change:
Generation before:
Generation after:
Here's why -- here's the tokens the model generated after I fixed the parameter.
Notice the repeated sequence of tokens:
that the model was unable to generate before this change.
Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
tested and deployed thouroughly on localhost
Any specific deployment considerations
no
Docs