Views
No views yet
deepseek-ai/Janus-Pro-1B for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.JanusConditionalGenerate, 1B).1import os
2os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
3
4from PIL import Image
5from zeromodels.models.janus import JanusConditionalGenerate, JanusProcessor
6
7model = JanusConditionalGenerate.from_weights("zeromodels/janus_pro_1b")
8processor = JanusProcessor.from_weights("zeromodels/janus_pro_1b")
9
10image = Image.open("your_image.jpg")
11inputs = processor(
12 conversation=[
13 {
14 "role": "user",
15 "content": [
16 {"type": "image", "image": image},
17 {"type": "text", "text": "Describe this image in one sentence."},
18 ],
19 }
20 ]
21)
22outputs = model.generate(**inputs, max_new_tokens=64)
23print(processor.decode(outputs[0]))from_weights("zeromodels/<variant>"):| Variant | Hub |
|---|---|
janus_pro_1b | zeromodels/janus_pro_1b |
janus_pro_7b | zeromodels/janus_pro_7b |
KERAS_BACKEND before importing Keras / zeromodels.JanusProcessor.from_weights(...) so image size and tokenizer match.{"type": "image", ...} items for multi-image chats.hf: prefix, e.g. JanusConditionalGenerate.from_weights("hf:deepseek-ai/Janus-Pro-1B").