Spaces:
Runtime error
Runtime error
debug
Browse files12 unmodified lines131415161718192030 unmodified lines5152535455565758596012 unmodified linesimport torchfrom PIL import Imageyolo_model = get_yolo_model(model_path='weights/icon_detect/best.pt')caption_model_processor = get_caption_model_processor(model_name="florence2", model_name_or_path="weights/icon_caption_florence")platform = 'pc'if platform == 'pc':draw_bbox_config = {30 unmodified linesOmniParser is a screen parsing tool to convert general GUI screen to structured elements."""DEVICE = torch.device('cuda')# @spaces.GPU# @torch.inference_mode()# @torch.autocast(device_type="cuda", dtype=torch.bfloat16)@spaces.GPU(duration=65)def process(12 unmodified lines13141516171819202122232425262728293030 unmodified lines6162636465666768697012 unmodified linesimport torchfrom PIL import Image# yolo_model = get_yolo_model(model_path='weights/icon_detect/best.pt')# caption_model_processor = get_caption_model_processor(model_name="florence2", model_name_or_path="weights/icon_caption_florence")from ultralytics import YOLOyolo_model = YOLO('weights/icon_detect/best.pt').to('cuda')from transformers import AutoProcessor, AutoModelForCausalLMprocessor = AutoProcessor.from_pretrained("microsoft/Florence-2-base", trust_remote_code=True)model = AutoModelForCausalLM.from_pretrained("weights/icon_caption_florence", torch_dtype=torch.float16, trust_remote_code=True).to('cuda')caption_model_processor = {'processor': processor, 'model': model}print('finish loading model!!!')platform = 'pc'if platform == 'pc':draw_bbox_config = {30 unmodified linesOmniParser is a screen parsing tool to convert general GUI screen to structured elements."""# DEVICE = torch.device('cuda')# @spaces.GPU@torch.inference_mode()# @torch.autocast(device_type="cuda", dtype=torch.bfloat16)@spaces.GPU(duration=65)def process(
app.py+14-4