Skip to content

Commit 1a8ab30

Browse files
committed
fix
1 parent 9191781 commit 1a8ab30

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

samples/cpp/text_generation/lora_greedy_causal_lm.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ int main(int argc, char* argv[]) try {
1919

2020
// Resetting config to set greedy behaviour ignoring generation config from model directory.
2121
// It helps to compare two generations with and without LoRA adapter.
22+
// LLMPipeline pipe(models_path, device);
2223
ov::genai::GenerationConfig config;
2324
config.max_new_tokens = 100;
2425
pipe.set_generation_config(config);
@@ -30,7 +31,8 @@ int main(int argc, char* argv[]) try {
3031
std::cout << "\n-----------------------------";
3132
std::cout << "\nGenerate without LoRA adapter:" << std::endl;
3233
// // LLMPipeline pipe1(models_path, device); // register all required adapters here
33-
std::cout << pipe.generate(prompt, max_new_tokens(100), adapters()) << std::endl;
34+
35+
// std::cout << pipe.generate(prompt, max_new_tokens(100)) << std::endl;
3436

3537
} catch (const std::exception& error) {
3638
std::cerr << error.what() << '\n';

src/cpp/src/lora/adapter.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ struct LoRAStateGetterForConst : public BaseStateGetter {
477477
variable_ids(variable_ids) {}
478478

479479
std::optional<LoRAConstantNode> operator() (NodePtr node) const {
480-
std::cout << "LoRAStateGetterForConst operator()" << std::endl;
480+
// std::cout << "LoRAStateGetterForConst operator()" << std::endl;
481481
std::string name = node->get_friendly_name();
482482
if (auto params = getter(name)) {
483483
// FIXME: Potential name conflict if LoRA is applied multiple times by using this infrastructure independently each time (not a recommended approach).
@@ -486,8 +486,6 @@ struct LoRAStateGetterForConst : public BaseStateGetter {
486486
LoRAConstantNode result;
487487
ov::op::util::VariableInfo variable_info;
488488

489-
std::cout << "111 " << params->tensor->get_output_element_type(0) << std::endl;
490-
491489
// FIXME: No guarantees on ordering of state in InferRequest makes impossible using indices of variables later, forced to use variable_id instead
492490
variable_info = ov::op::util::VariableInfo{
493491
params->tensor->get_output_shape(0),
@@ -619,9 +617,6 @@ class LoRAReplaceConstantTransformDynamic : public LoRAReplaceConstantTransform
619617
bool apply(NodePtr node, const LoRAConstantNode& lora_weight) override {
620618
auto consumers = node->get_output_target_inputs(0);
621619

622-
std::cout << lora_weight.tensor->get_element_type() << std::endl;
623-
std::cout << node->get_element_type() << std::endl;
624-
625620
const auto node_type = node->get_element_type();
626621

627622
// Приводим tensor к типу node
@@ -653,7 +648,6 @@ class LoRAReplaceConstantTransformDynamic : public LoRAReplaceConstantTransform
653648

654649
for (auto& consumer : consumers) {
655650
consumer.replace_source_output(if_node->output(0));
656-
std::cout << consumer.get_node()->get_element_type() << std::endl;
657651
}
658652
return true;
659653
}
@@ -690,14 +684,12 @@ NodePtr tensors_multiplication(NodePtr input,
690684
const auto target_shape = target.get_partial_shape();
691685
const auto target_rank = target_shape.rank().get_length();
692686

693-
std::cout << 'tensors_multiplication' << std::endl;
687+
std::cout << '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!tensors_multiplication' << std::endl;
694688

695689
for (size_t i = 0; i < multipliers.size(); ++i) {
696690
NodePtr normalized = multipliers[i];
697-
std::cout <<"aaa "<< normalized->get_output_element_type(0).get_type_name() << std::endl;
698691
if (normalized->get_output_element_type(0) != target_type) {
699692
normalized = std::make_shared<v0::Convert>(normalized, target_type);
700-
std::cout <<"bbb "<< normalized->get_output_element_type(0).get_type_name() << std::endl;
701693
if (std::dynamic_pointer_cast<v0::Constant>(normalized)) {
702694
input->get_rt_info()["decompression"];
703695
}

0 commit comments

Comments
 (0)