Skip to content

Commit

Permalink
Updated pyi files
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Dec 3, 2024
1 parent b1d3fc0 commit 2b679cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 39 deletions.
6 changes: 2 additions & 4 deletions src/python/openvino_genai/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ 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
Expand All @@ -36,5 +34,5 @@ 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'
__all__ = ['Adapter', 'AdapterConfig', 'AggregationMode', 'AutoencoderKL', 'CLIPTextModel', 'CLIPTextModelWithProjection', 'CacheEvictionConfig', 'ContinuousBatchingPipeline', 'CppStdGenerator', 'DecodedResults', 'EncodedResults', 'GenerationConfig', 'GenerationResult', 'Generator', 'LLMPipeline', 'PerfMetrics', 'RawPerfMetrics', 'Scheduler', 'SchedulerConfig', 'StopCriteria', 'StreamerBase', 'Text2ImagePipeline', 'TokenizedInputs', 'Tokenizer', 'UNet2DConditionModel', 'VLMPipeline', 'WhisperGenerationConfig', 'WhisperPipeline', 'draft_model', 'openvino', 'os', 'py_openvino_genai']
__version__: str = '2024.5.0.0'
47 changes: 12 additions & 35 deletions src/python/openvino_genai/py_openvino_genai.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from __future__ import annotations
import openvino._pyopenvino
import os
import typing
__all__ = ['Adapter', 'AdapterConfig', 'AggregationMode', 'AutoencoderKL', 'CLIPTextModel', 'CLIPTextModelWithProjection', 'CacheEvictionConfig', 'ChunkStreamerBase', 'ContinuousBatchingPipeline', 'CppStdGenerator', 'DecodedResults', 'EncodedGenerationResult', 'EncodedResults', 'GenerationConfig', 'GenerationFinishReason', 'GenerationHandle', 'GenerationOutput', 'GenerationResult', 'GenerationStatus', 'Generator', 'ImageGenerationConfig', 'LLMPipeline', 'MeanStdPair', 'PerfMetrics', 'PipelineMetrics', 'RawPerfMetrics', 'Scheduler', 'SchedulerConfig', 'StopCriteria', 'StreamerBase', 'Text2ImagePipeline', 'TokenizedInputs', 'Tokenizer', 'UNet2DConditionModel', 'VLMPipeline', 'WhisperDecodedResultChunk', 'WhisperDecodedResults', 'WhisperGenerationConfig', 'WhisperPipeline', 'draft_model']
__all__ = ['Adapter', 'AdapterConfig', 'AggregationMode', 'AutoencoderKL', 'CLIPTextModel', 'CLIPTextModelWithProjection', 'CacheEvictionConfig', 'ContinuousBatchingPipeline', 'CppStdGenerator', 'DecodedResults', 'EncodedGenerationResult', 'EncodedResults', 'GenerationConfig', 'GenerationFinishReason', 'GenerationHandle', 'GenerationOutput', 'GenerationResult', 'GenerationStatus', 'Generator', 'ImageGenerationConfig', 'LLMPipeline', 'MeanStdPair', 'PerfMetrics', 'PipelineMetrics', 'RawPerfMetrics', 'Scheduler', 'SchedulerConfig', 'StopCriteria', 'StreamerBase', 'Text2ImagePipeline', 'TokenizedInputs', 'Tokenizer', 'UNet2DConditionModel', 'VLMPipeline', 'WhisperDecodedResultChunk', 'WhisperDecodedResults', 'WhisperGenerationConfig', 'WhisperPipeline', 'draft_model']
class Adapter:
"""
Immutable LoRA Adapter that carries the adaptation matrices and serves as unique adapter identifier.
Expand Down Expand Up @@ -204,7 +204,7 @@ class AutoencoderKL:
"""
def decode(self, latent: openvino._pyopenvino.Tensor) -> openvino._pyopenvino.Tensor:
...
def encode(self, image: openvino._pyopenvino.Tensor, generator: Generator) -> openvino._pyopenvino.Tensor:
def encode(self, image: openvino._pyopenvino.Tensor) -> openvino._pyopenvino.Tensor:
...
def get_config(self) -> AutoencoderKL.Config:
...
Expand Down Expand Up @@ -337,25 +337,6 @@ class CacheEvictionConfig:
...
def get_start_size(self) -> int:
...
class ChunkStreamerBase:
"""
Base class for chunk streamers. In order to use inherit from from this class.
"""
def __init__(self) -> None:
...
def end(self) -> None:
"""
End is called at the end of generation. It can be used to flush cache if your own streamer has one
"""
def put(self, arg0: int) -> bool:
"""
Put is called every time new token is generated. Returns a bool flag to indicate whether generation should be stopped, if return true generation stops
"""
def put_chunk(self, arg0: list[int]) -> bool:
"""
Put is called every time new token chunk is generated. Returns a bool flag to indicate whether generation should be stopped, if return true generation stops
"""
class ContinuousBatchingPipeline:
"""
This class is used for generation with LLMs with continuous batchig
Expand Down Expand Up @@ -484,9 +465,9 @@ class GenerationConfig:
ignore_eos: if set to true, then generation will not stop even if <eos> token is met.
eos_token_id: token_id of <eos> (end of sentence)
min_new_tokens: set 0 probability for eos_token_id for the first eos_token_id generated tokens. Ignored for non continuous batching.
stop_strings: list of strings that will cause pipeline to stop generating further tokens. Ignored for non continuous batching.
stop_strings: a set of strings that will cause pipeline to stop generating further tokens.
include_stop_str_in_output: if set to true stop string that matched generation will be included in generation output (default: false)
stop_token_ids: list of tokens that will cause pipeline to stop generating further tokens. Ignored for non continuous batching.
stop_token_ids: a set of tokens that will cause pipeline to stop generating further tokens.
echo: if set to true, the model will echo the prompt in the output.
logprobs: number of top logprobs computed for each position, if set to 0, logprobs are not computed and value 0.0 is returned.
Currently only single top logprob can be returned, so any logprobs > 1 is treated as logprobs == 1. (default: 0).
Expand Down Expand Up @@ -706,7 +687,6 @@ class ImageGenerationConfig:
generator: Generator
guidance_scale: float
height: int
max_sequence_length: int
negative_prompt: str | None
negative_prompt_2: str | None
negative_prompt_3: str | None
Expand Down Expand Up @@ -757,9 +737,9 @@ class LLMPipeline:
ignore_eos: if set to true, then generation will not stop even if <eos> token is met.
eos_token_id: token_id of <eos> (end of sentence)
min_new_tokens: set 0 probability for eos_token_id for the first eos_token_id generated tokens. Ignored for non continuous batching.
stop_strings: list of strings that will cause pipeline to stop generating further tokens. Ignored for non continuous batching.
stop_strings: a set of strings that will cause pipeline to stop generating further tokens.
include_stop_str_in_output: if set to true stop string that matched generation will be included in generation output (default: false)
stop_token_ids: list of tokens that will cause pipeline to stop generating further tokens. Ignored for non continuous batching.
stop_token_ids: a set of tokens that will cause pipeline to stop generating further tokens.
echo: if set to true, the model will echo the prompt in the output.
logprobs: number of top logprobs computed for each position, if set to 0, logprobs are not computed and value 0.0 is returned.
Currently only single top logprob can be returned, so any logprobs > 1 is treated as logprobs == 1. (default: 0).
Expand Down Expand Up @@ -838,9 +818,9 @@ class LLMPipeline:
ignore_eos: if set to true, then generation will not stop even if <eos> token is met.
eos_token_id: token_id of <eos> (end of sentence)
min_new_tokens: set 0 probability for eos_token_id for the first eos_token_id generated tokens. Ignored for non continuous batching.
stop_strings: list of strings that will cause pipeline to stop generating further tokens. Ignored for non continuous batching.
stop_strings: a set of strings that will cause pipeline to stop generating further tokens.
include_stop_str_in_output: if set to true stop string that matched generation will be included in generation output (default: false)
stop_token_ids: list of tokens that will cause pipeline to stop generating further tokens. Ignored for non continuous batching.
stop_token_ids: a set of tokens that will cause pipeline to stop generating further tokens.
echo: if set to true, the model will echo the prompt in the output.
logprobs: number of top logprobs computed for each position, if set to 0, logprobs are not computed and value 0.0 is returned.
Currently only single top logprob can be returned, so any logprobs > 1 is treated as logprobs == 1. (default: 0).
Expand Down Expand Up @@ -1268,10 +1248,9 @@ class Text2ImagePipeline:
height: int - height of resulting images,
width: int - width of resulting images,
num_inference_steps: int - number of inference steps,
generator: openvino_genai.CppStdGenerator or class inherited from openvino_genai.Generator - random generator,
adapters: LoRA adapters,
strength: strength for image to image generation. 1.0f means initial image is fully noised,
max_sequence_length: int - length of t5_encoder_model input
generator: openvino_genai.CppStdGenerator or class inherited from openvino_genai.Generator - random generator
adapters: LoRA adapters
strength: strength for image to image generation. 1.0f means initial image is fully noised
:return: ov.Tensor with resulting images
:rtype: ov.Tensor
Expand Down Expand Up @@ -1381,8 +1360,6 @@ class UNet2DConditionModel:
device (str): Device to run the model on (e.g., CPU, GPU).
kwargs: Device properties.
"""
def do_classifier_free_guidance(self, guidance_scale: float) -> bool:
...
def get_config(self) -> UNet2DConditionModel.Config:
...
def infer(self, sample: openvino._pyopenvino.Tensor, timestep: openvino._pyopenvino.Tensor) -> openvino._pyopenvino.Tensor:
Expand Down Expand Up @@ -1613,7 +1590,7 @@ class WhisperPipeline:
models_path (os.PathLike): Path to the model file.
device (str): Device to run the model on (e.g., CPU, GPU).
"""
def generate(self, raw_speech_input: list[float], generation_config: WhisperGenerationConfig | None = None, streamer: typing.Callable[[str], bool] | ChunkStreamerBase | None = None, **kwargs) -> DecodedResults:
def generate(self, raw_speech_input: list[float], generation_config: WhisperGenerationConfig | None = None, streamer: typing.Callable[[str], bool] | StreamerBase | None = None, **kwargs) -> DecodedResults:
"""
High level generate that receives raw speech as a vector of floats and returns decoded output.
Expand Down

0 comments on commit 2b679cf

Please sign in to comment.