AdithyaSK's picture
Update README.md
63d8ce8 verified
metadata
pipeline_tag: image-text-to-text
library_name: transformers
language:
  - multilingual
tags:
  - got
  - vision-language
  - ocr2.0
  - custom_code
license: apache-2.0

Nayana_base_combined_v1

from transformers import AutoModel, AutoTokenizer
from peft import PeftModel, PeftConfig, AutoPeftModelForCausalLM
from transformers import AutoModelForCausalLM
import torch

tokenizer = AutoTokenizer.from_pretrained('v1v1d/Nayana_base_combined', trust_remote_code=True , torch_dtype=torch.float16)
model = AutoModel.from_pretrained('v1v1d/Nayana_base_combined', trust_remote_code=True, low_cpu_mem_usage=True, device_map='cuda', use_safetensors=True, pad_token_id=tokenizer.eos_token_id , torch_dtype=torch.float16)


model = model.eval().cuda()

image_file = 'hindi.png'
res = model.chat(tokenizer, image_file, ocr_type='ocr' , render=True, stream_flag = True)

print(res)