Skip to content

Should we build remote interface for UForm? #13

Closed Answered by ashvardanian
VoVoR asked this question in Q&A
Discussion options

You must be logged in to vote

Of course! The question should be, how exactly do we build the remote interface?

At this point, all of the checkpoints pre-packaged into UForm are tiny. They are easy to deploy in any embedded setup. But some of the networks we are currently baking may require a custom setup for efficient inference at scale.

from ujrpc.rich_posix import Server
import ufrom

server = Server()
model = uform.get_model('unum-cloud/uform-vl-multilingual')

@server
def vectorize(description: str, photo: PIL.Image.Image) -> numpy.ndarray:
    image = model.preprocess_image(photo)
    tokens = model.preprocess_text(description)
    joint_embedding = model.encode_multimodal(image=image, text=tokens)

    return jo…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by VoVoR
Comment options

VoVoR
Mar 16, 2023
Collaborator Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants