This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
NewerOlder