gpu support
Browse filesFiles changed (2)
- handler.py+1-1
- test_handler_locally.pyAdded+16
10 unmodified lines1112131415161710 unmodified linesself.processor = LlavaNextProcessor.from_pretrained("llava-hf/llava-v1.6-mistral-7b-hf")device = 'cpu' if torch.cuda.is_available() else 'cpu'model = LlavaNextForConditionalGeneration.from_pretrained("llava-hf/llava-v1.6-mistral-7b-hf",10 unmodified lines1112131415161710 unmodified linesself.processor = LlavaNextProcessor.from_pretrained("llava-hf/llava-v1.6-mistral-7b-hf")device = 'gpu' if torch.cuda.is_available() else 'cpu'model = LlavaNextForConditionalGeneration.from_pretrained("llava-hf/llava-v1.6-mistral-7b-hf",
12345678910111213141516from handler import EndpointHandler
# init handlermy_handler = EndpointHandler(path=".")
# prepare sample payloadprompt = "Can you describe this picture focusing on specifics visual artifacts and ambiance (objects, colors, person, athmosphere..). Please stay concise only output keywords and concepts detected."files = [ {"path": "https://media.rolex.com/image/upload/q_auto/f_auto/c_limit,w_2440/v1708384234/rolexcom/about-rolex/hub/about-rolex-hub-cover-aca202310cw-0002-portrait"}]
# test the handlerresults=my_handler({ 'prompt': prompt, 'files': files})handler.py+1-1
test_handler_locally.pyAdded+16