Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archive #59

Draft
wants to merge 25 commits into
base: generate_pipeline
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
openvino_genai->openvino/genai
Wovchena committed May 18, 2024
commit a8aac662445abc2d43014b2ccdae17304625cac1
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@

#include "openvino/runtime/compiled_model.hpp"
#include "openvino/runtime/infer_request.hpp"
#include "openvino_genai/tokenizer.hpp"
#include "openvino/genai/tokenizer.hpp"

namespace ov {

@@ -54,7 +54,7 @@ enum class StopCriteria { early, heuristic, never };
* @param eos_token <eos> token string representation
* @param draft_model draft model for assitive decoding
*/
class OPENVINO_GENAI_EXPORTS GenerationConfig {
class openvino/genai_EXPORTS GenerationConfig {
public:
GenerationConfig() = default;
GenerationConfig(std::string json_path);
Original file line number Diff line number Diff line change
@@ -7,9 +7,9 @@
#include <variant>

#include <openvino/core/any.hpp>
#include "openvino_genai/generation_config.hpp"
#include "openvino_genai/tokenizer.hpp"
#include "openvino_genai/streamer_base.hpp"
#include "openvino/genai/generation_config.hpp"
#include "openvino/genai/tokenizer.hpp"
#include "openvino/genai/streamer_base.hpp"

namespace ov {

@@ -44,7 +44,7 @@ class DecodedResults {
/**
* @brief This class is used for generation with LLMs.
*/
class OPENVINO_GENAI_EXPORTS LLMPipeline {
class openvino/genai_EXPORTS LLMPipeline {
public:
/**
* @brief Constructs a LLMPipeline when convert model xml/bin files, tokenizers and configuration and in the same dir.
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

#pragma once

#include "openvino_genai/tokenizer.hpp"
#include "openvino/genai/tokenizer.hpp"

namespace ov {

Original file line number Diff line number Diff line change
@@ -7,14 +7,14 @@
#include <vector>
#include <initializer_list>
#include <openvino/runtime/tensor.hpp>
#include "openvino_genai/visibility.hpp"
#include "openvino/genai/visibility.hpp"

namespace ov {

/**
* @brief class is used to encode prompts and decode resulting tokens
*/
class OPENVINO_GENAI_EXPORTS Tokenizer {
class openvino/genai_EXPORTS Tokenizer {
public:
/**
* @brief ov::Tokenizer constructor.
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
#include "openvino/core/visibility.hpp"

#ifdef genai_EXPORTS
# define OPENVINO_GENAI_EXPORTS OPENVINO_CORE_EXPORTS
# define openvino/genai_EXPORTS OPENVINO_CORE_EXPORTS
#else
# define OPENVINO_GENAI_EXPORTS OPENVINO_CORE_IMPORTS
# define openvino/genai_EXPORTS OPENVINO_CORE_IMPORTS
#endif // genai_EXPORTS
2 changes: 1 addition & 1 deletion src/cpp/src/generation_config.cpp
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
#include <nlohmann/json.hpp>
#include <openvino/runtime/core.hpp>

#include "openvino_genai/generation_config.hpp"
#include "openvino/genai/generation_config.hpp"

#include "generation_config_helper.hpp"

2 changes: 1 addition & 1 deletion src/cpp/src/generation_config_helper.hpp
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

#pragma once

#include "openvino_genai/generation_config.hpp"
#include "openvino/genai/generation_config.hpp"

namespace ov {

2 changes: 1 addition & 1 deletion src/cpp/src/greedy_decoding.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include "generation_config_helper.hpp"
#include "openvino_genai/llm_pipeline.hpp"
#include "openvino/genai/llm_pipeline.hpp"
#include "utils.hpp"

namespace ov {
4 changes: 2 additions & 2 deletions src/cpp/src/group_beam_searcher.hpp
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
#pragma once

#include <openvino/runtime/tensor.hpp>
#include "openvino_genai/generation_config.hpp"
#include "openvino_genai/llm_pipeline.hpp"
#include "openvino/genai/generation_config.hpp"
#include "openvino/genai/llm_pipeline.hpp"

namespace ov {
EncodedResults beam_search(ov::InferRequest& lm, ov::Tensor prompts, ov::Tensor attentin_mask, GenerationConfig sampling_params);
4 changes: 2 additions & 2 deletions src/cpp/src/llm_pipeline.cpp
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@
#include <jinja2cpp/template_env.h>

#include <openvino/openvino.hpp>
#include "openvino_genai/generation_config.hpp"
#include "openvino_genai/llm_pipeline.hpp"
#include "openvino/genai/generation_config.hpp"
#include "openvino/genai/llm_pipeline.hpp"
#include "utils.hpp"
#include "generation_config_helper.hpp"
#include "group_beam_searcher.hpp"
4 changes: 2 additions & 2 deletions src/cpp/src/text_callback_streamer.hpp
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once

#include "openvino_genai/streamer_base.hpp"
#include "openvino_genai/tokenizer.hpp"
#include "openvino/genai/streamer_base.hpp"
#include "openvino/genai/tokenizer.hpp"

namespace ov {

2 changes: 1 addition & 1 deletion src/cpp/src/tokenizer.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <openvino/openvino.hpp>
#include "openvino_genai/tokenizer.hpp"
#include "openvino/genai/tokenizer.hpp"
#include "utils.hpp"

namespace {
2 changes: 1 addition & 1 deletion src/python/py_generate_pipeline.cpp
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/functional.h>
#include "openvino_genai/llm_pipeline.hpp"
#include "openvino/genai/llm_pipeline.hpp"

namespace py = pybind11;
using namespace ov;
2 changes: 1 addition & 1 deletion text_generation/causal_lm/cpp/beam_search_causal_lm.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2023-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include <openvino_genai/llm_pipeline.hpp>
#include <openvino/genai/llm_pipeline.hpp>

namespace {
enum SPECIAL_TOKEN { PAD_TOKEN = 2 };
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#include <openvino/openvino.hpp>
#include "openvino_genai/llm_pipeline.hpp"
#include "openvino/genai/llm_pipeline.hpp"

using namespace std;

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2023-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "openvino_genai/llm_pipeline.hpp"
#include "openvino/genai/llm_pipeline.hpp"

using std::cout;
using std::endl;
2 changes: 1 addition & 1 deletion text_generation/causal_lm/cpp/greedy_causal_lm.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2023-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "openvino_genai/llm_pipeline.hpp"
#include "openvino/genai/llm_pipeline.hpp"

int main(int argc, char* argv[]) try {
if (3 > argc || argc > 4)