Skip to content

Commit

Permalink
Removing debug couts
Browse files Browse the repository at this point in the history
Signed-off-by: Shrinath Suresh <[email protected]>
  • Loading branch information
shrinath-suresh committed Sep 13, 2023
1 parent 026b836 commit c95a576
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions cpp/src/examples/llamacpp/llamacpp_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ std::vector<torch::jit::IValue> LlamacppHandler::Preprocess(
std::pair<std::string&, std::map<uint8_t, std::string>&>& idx_to_req_id,
std::shared_ptr<torchserve::InferenceRequestBatch>& request_batch,
std::shared_ptr<torchserve::InferenceResponseBatch>& response_batch) {
std::cout << "Initializing llama context" << std::endl;


initialize_context();

std::cout << "Llama context initialized" << std::endl;

std::vector<torch::jit::IValue> batch_ivalue;
std::vector<torch::Tensor> batch_tensors;
uint8_t idx = 0;
Expand Down Expand Up @@ -113,10 +110,6 @@ std::vector<torch::jit::IValue> LlamacppHandler::Preprocess(
continue;
}

std::cout << "Received Input: " << data_it->second << std::endl;

// std::vector new_data = request.parameters["data"];
// std::string msg = torchserve::Converter::VectorToStr(new_data);
std::string msg = torchserve::Converter::VectorToStr(data_it->second);

// tokenization
Expand Down Expand Up @@ -228,10 +221,6 @@ torch::Tensor LlamacppHandler::Inference(
break;
}

// print the new token :
std::cout << "New Token: " << llama_token_to_piece(llama_ctx, new_token_id)
<< std::endl;

// push this new token for next evaluation
tokens_list.push_back(new_token_id);
}
Expand Down Expand Up @@ -265,7 +254,6 @@ void LlamacppHandler::Postprocess(
}

std::string generated_text_str = generated_text_stream.str();
std::cout << "Generated Text Str: " << generated_text_str << std::endl;

auto response = (*response_batch)[kv.second];

Expand Down

0 comments on commit c95a576

Please sign in to comment.