Skip to content

Commit

Permalink
Stubs files for genai bindings (#1158)
Browse files Browse the repository at this point in the history
      CVS-156607
  • Loading branch information
popovaan authored Nov 12, 2024
1 parent 9f636e9 commit fbd6e68
Show file tree
Hide file tree
Showing 15 changed files with 1,931 additions and 99 deletions.
13 changes: 13 additions & 0 deletions src/cpp/include/openvino/genai/visual_language/pipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ class OPENVINO_GENAI_EXPORTS VLMPipeline {
const StreamerVariant& streamer
);

/// @brief Generate a response given a prompt and uint8 RGB image with [NHWC] or [HWC] layout.
/// @param prompt A prompt to respond to.
/// @param image Image to be prepended to a prompt.
/// @param generation_config A config to follow for text generation.
/// @param streamer A streamer to acquire intermediate result.
/// @return A string generated by a model.
DecodedResults generate(
const std::string& prompt,
const ov::Tensor& rgb,
const GenerationConfig& generation_config,
const StreamerVariant& streamer
);

/// @brief Generate a response given a prompt and config.
/// @param prompt A prompt to respond to.
/// @param config_map A config may contain GenerationConfig, values
Expand Down
9 changes: 9 additions & 0 deletions src/cpp/src/visual_language/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ DecodedResults VLMPipeline::generate(
return m_pimpl->generate(prompt, rgbs, generation_config, streamer);
}

DecodedResults VLMPipeline::generate(
const std::string& prompt,
const ov::Tensor& rgb,
const GenerationConfig& generation_config,
const StreamerVariant& streamer
) {
return m_pimpl->generate(prompt, {rgb}, generation_config, streamer);
}

DecodedResults VLMPipeline::generate(
const std::string& prompt,
const ov::AnyMap& config_map
Expand Down
40 changes: 40 additions & 0 deletions src/python/openvino_genai/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""
openvino genai module namespace, exposing pipelines and configs to create these pipelines.
"""
from __future__ import annotations
import openvino as openvino
from openvino_genai.py_openvino_genai import Adapter
from openvino_genai.py_openvino_genai import AdapterConfig
from openvino_genai.py_openvino_genai import AggregationMode
from openvino_genai.py_openvino_genai import AutoencoderKL
from openvino_genai.py_openvino_genai import CLIPTextModel
from openvino_genai.py_openvino_genai import CLIPTextModelWithProjection
from openvino_genai.py_openvino_genai import CacheEvictionConfig
from openvino_genai.py_openvino_genai import ChunkStreamerBase
from openvino_genai.py_openvino_genai import ContinuousBatchingPipeline
from openvino_genai.py_openvino_genai import CppStdGenerator
from openvino_genai.py_openvino_genai import DecodedResults
from openvino_genai.py_openvino_genai import EncodedResults
from openvino_genai.py_openvino_genai import GenerationConfig
from openvino_genai.py_openvino_genai import GenerationResult
from openvino_genai.py_openvino_genai import Generator
from openvino_genai.py_openvino_genai import ImageGenerationConfig
from openvino_genai.py_openvino_genai import LLMPipeline
from openvino_genai.py_openvino_genai import PerfMetrics
from openvino_genai.py_openvino_genai import RawPerfMetrics
from openvino_genai.py_openvino_genai import Scheduler
from openvino_genai.py_openvino_genai import SchedulerConfig
from openvino_genai.py_openvino_genai import StopCriteria
from openvino_genai.py_openvino_genai import StreamerBase
from openvino_genai.py_openvino_genai import Text2ImagePipeline
from openvino_genai.py_openvino_genai import TokenizedInputs
from openvino_genai.py_openvino_genai import Tokenizer
from openvino_genai.py_openvino_genai import UNet2DConditionModel
from openvino_genai.py_openvino_genai import VLMPipeline
from openvino_genai.py_openvino_genai import WhisperGenerationConfig
from openvino_genai.py_openvino_genai import WhisperPipeline
from openvino_genai.py_openvino_genai import draft_model
import os as os
from . import py_openvino_genai
__all__ = ['Adapter', 'AdapterConfig', 'AggregationMode', 'AutoencoderKL', 'CLIPTextModel', 'CLIPTextModelWithProjection', 'CacheEvictionConfig', 'ChunkStreamerBase', 'ContinuousBatchingPipeline', 'CppStdGenerator', 'DecodedResults', 'EncodedResults', 'GenerationConfig', 'GenerationResult', 'Generator', 'ImageGenerationConfig', 'LLMPipeline', 'PerfMetrics', 'RawPerfMetrics', 'Scheduler', 'SchedulerConfig', 'StopCriteria', 'StreamerBase', 'Text2ImagePipeline', 'TokenizedInputs', 'Tokenizer', 'UNet2DConditionModel', 'VLMPipeline', 'WhisperGenerationConfig', 'WhisperPipeline', 'draft_model', 'openvino', 'os', 'py_openvino_genai']
__version__: str = '2025.0.0.0'
Loading

0 comments on commit fbd6e68

Please sign in to comment.