Views
No views yet


1# Option1:
2pip install git+https://github.com/Tencent/HaploVLM.git
3
4# Option2:
5git clone https://github.com/Tencent/HaploVLM.git
6cd HaploVLM
7pip install -e . -v1from haplo import HaploProcessor, HaploForConditionalGeneration
2
3processor = HaploProcessor.from_pretrained('stevengrove/Haplo-7B-Pro-Video')
4model = HaploForConditionalGeneration.from_pretrained(
5 'stevengrove/Haplo-7B-Pro-Video',
6 torch_dtype=torch.bfloat16
7).to('cuda')
8
9conversation = [
10 {'role': 'user', 'content': [
11 {'type': 'text', 'text': 'Describe this image.'},
12 {'type': 'image', 'path': 'assets/example-image.png'}
13 ]}
14]
15
16inputs = processor.apply_chat_template(
17 conversation,
18 add_generation_prompt=True,
19 return_tensors='pt'
20).to('cuda')
21
22outputs = model.generate(inputs)
23print(processor.decode(outputs[0]))1@article{yang2024haplo,
2 title={HaploVL: A Single-Transformer Baseline for Multi-Modal Understanding},
3 author={Yang, Rui and Song, Lin and Xiao, Yicheng and Huang, Runhui and Ge, Yixiao and Shan, Ying and Zhao, Hengshuang},
4 journal={arXiv preprint arXiv:xxxx.xxxxx},
5 year={2025}
6}