Skip to content

Instantly share code, notes, and snippets.

View helena-intel's full-sized avatar

Helena Kloosterman helena-intel

View GitHub Profile
"""
OpenVINO LLM chat sample that uses greedy search for reproducible inference
Prerequisites:
- pip install openvino-genai
- an OpenVINO LLM.
Usage: python llm_chat.py /path/to/ov_model DEVICE
Modified from https://github.com/openvinotoolkit/openvino.genai/tree/master/samples/python/chat_sample
@helena-intel
helena-intel / CMakeLists.txt
Last active August 19, 2024 12:45
Create a basic redistributable OpenVINO GenAI application
cmake_minimum_required(VERSION 3.10)
project(GenaiExampleProject)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
find_package(OpenVINOGenAI REQUIRED)
# Replace backslashes in %USERPROFILE%
string(REPLACE "\\" "/" USERPROFILE_FIXED $ENV{USERPROFILE})
include_directories("${USERPROFILE_FIXED}/tools/openvino_20243/runtime/include")
link_directories("${USERPROFILE_FIXED}/tools/openvino_20243/runtime/lib/intel64/Release")
add_executable(example example.cpp)
@helena-intel
helena-intel / CMakeLists.txt
Last active August 28, 2024 08:58
OpenVINO GenAI C++ example, building OpenVINO and OpenVINO GenAI from source
cmake_minimum_required(VERSION 3.10)
project(GenaiExampleProject)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
find_package(OpenVINOGenAI REQUIRED)
string(REPLACE "\\" "/" USERPROFILE_FIXED $ENV{USERPROFILE})
include_directories("${USERPROFILE_FIXED}/tools/openvino/runtime/include")
link_directories("${USERPROFILE_FIXED}/tools/openvino/runtime/lib/intel64/Release")
add_executable(example example.cpp)
target_link_libraries(example PRIVATE openvino::genai)
@helena-intel
helena-intel / launch_notebooks.py
Last active May 8, 2021 11:09
Launch OpenVINO notebooks.
#!/usr/bin/env python3
import subprocess
import sys
from pathlib import Path
import os
pythonpath = sys.executable
curdir = Path(__file__).parent.resolve()
parentdir = curdir.parent
import io
from enum import Enum
from typing import Optional
import cv2
import numpy as np
from openvino.inference_engine import IECore
from opyrator.components.types import FileContent
from PIL import Image, ImageDraw, ImageFont
from pydantic import BaseModel, Field
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.