Skip to content

Commit

Permalink
use raw request pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
mzegla committed Sep 6, 2024
1 parent 2aff1fc commit b3c306e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/llm/apis/openai_completions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ OpenAIChatCompletionsHandler::OpenAIChatCompletionsHandler(Document& doc, Endpoi
endpoint(endpoint),
created(creationTime),
tokenizer(tokenizer) {
request = std::make_unique<OpenAIChatCompletionsRequest>();
request = new OpenAIChatCompletionsRequest;
}

OpenAIChatCompletionsHandler::~OpenAIChatCompletionsHandler() = default;
OpenAIChatCompletionsHandler::~OpenAIChatCompletionsHandler() { delete request; }

absl::Status OpenAIChatCompletionsHandler::parseCompletionsPart() {
// prompt: string
Expand Down
3 changes: 1 addition & 2 deletions src/llm/apis/openai_completions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//*****************************************************************************
#pragma once

#include <memory>
#include <optional>
#include <set>
#include <sstream>
Expand Down Expand Up @@ -65,7 +64,7 @@ class OpenAIChatCompletionsHandler {
Document& doc;
Endpoint endpoint;
CompletionUsageStatistics usage;
std::unique_ptr<OpenAIChatCompletionsRequest> request{nullptr};
OpenAIChatCompletionsRequest* request = nullptr;
std::chrono::time_point<std::chrono::system_clock> created;
ov::genai::Tokenizer tokenizer;

Expand Down

0 comments on commit b3c306e

Please sign in to comment.