diff --git a/modules/openvino_code/package-lock.json b/modules/openvino_code/package-lock.json index 33d55b8d2..433dacc74 100644 --- a/modules/openvino_code/package-lock.json +++ b/modules/openvino_code/package-lock.json @@ -1,12 +1,12 @@ { "name": "openvino-code-completion", - "version": "0.0.11", + "version": "0.0.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openvino-code-completion", - "version": "0.0.11", + "version": "0.0.12", "license": "https://github.com/openvinotoolkit/openvino_contrib/blob/master/LICENSE", "workspaces": [ "side-panel-ui" diff --git a/modules/openvino_code/package.json b/modules/openvino_code/package.json index 078a54263..95f75b363 100644 --- a/modules/openvino_code/package.json +++ b/modules/openvino_code/package.json @@ -1,7 +1,7 @@ { "publisher": "OpenVINO", "name": "openvino-code-completion", - "version": "0.0.11", + "version": "0.0.12", "displayName": "OpenVINO Code Completion", "description": "VSCode extension for AI code completion with OpenVINO", "icon": "media/logo.png", @@ -199,6 +199,17 @@ ], "description": "Which model to use for code generation." }, + "openvinoCode.device": { + "order": 0, + "type": "string", + "default": "GPU", + "enum": [ + "CPU", + "GPU", + "NPU" + ], + "description": "Which device to use for code generation." + }, "openvinoCode.serverUrl": { "order": 1, "type": "string", diff --git a/modules/openvino_code/server/main.py b/modules/openvino_code/server/main.py index 3d86194e6..861fc3302 100644 --- a/modules/openvino_code/server/main.py +++ b/modules/openvino_code/server/main.py @@ -1,8 +1,12 @@ from src.utils import get_parser, setup_logger +import logging + # Logger should be set up before other imports to propagate logging config to other packages setup_logger() +logger = logging.getLogger("") + import uvicorn # noqa: E402 @@ -14,6 +18,9 @@ def main(): args = get_parser().parse_args() # temporary solution for cli args passing + + logger.error(args.model) + logger.error(args.device) generator_dependency = get_generator_dependency(args.model, args.device, args.tokenizer_checkpoint, args.assistant) app.dependency_overrides[get_generator_dummy] = generator_dependency diff --git a/modules/openvino_code/server/src/generators.py b/modules/openvino_code/server/src/generators.py index 761d652e2..14b9f957a 100644 --- a/modules/openvino_code/server/src/generators.py +++ b/modules/openvino_code/server/src/generators.py @@ -86,7 +86,7 @@ class OVGenerator(GeneratorFunctor): def __init__( self, checkpoint: str, - device: str = "CPU", + device: str = "GPU", tokenizer_checkpoint: Optional[str] = None, assistant_checkpoint: Optional[str] = None, summarize_stop_tokens: Optional[Container[str]] = SUMMARIZE_STOP_TOKENS, diff --git a/modules/openvino_code/shared/side-panel-message.ts b/modules/openvino_code/shared/side-panel-message.ts index 0c0720d6d..2ebdf20b6 100644 --- a/modules/openvino_code/shared/side-panel-message.ts +++ b/modules/openvino_code/shared/side-panel-message.ts @@ -10,6 +10,7 @@ export enum SidePanelMessageTypes { GENERATE_COMPLETION_CLICK = `${sidePanelMessagePrefix}.generateCompletionClick`, SETTINGS_CLICK = `${sidePanelMessagePrefix}.settingsClick`, MODEL_CHANGE = `${sidePanelMessagePrefix}.modelChange`, + DEVICE_CHANGE = `${sidePanelMessagePrefix}.deviceChange`, } export interface ISidePanelMessage
{
diff --git a/modules/openvino_code/side-panel-ui/src/components/sections/ServerSection/ServerSection.tsx b/modules/openvino_code/side-panel-ui/src/components/sections/ServerSection/ServerSection.tsx
index 68ed0ea33..5be1983a1 100644
--- a/modules/openvino_code/side-panel-ui/src/components/sections/ServerSection/ServerSection.tsx
+++ b/modules/openvino_code/side-panel-ui/src/components/sections/ServerSection/ServerSection.tsx
@@ -7,6 +7,9 @@ import { ServerStatus } from './ServerStatus/ServerStatus';
import './ServerSection.css';
import { ModelSelect } from './ModelSelect/ModelSelect';
import { ModelName } from '@shared/model';
+import { DeviceSelect } from './DeviceSelect/DeviceSelect';
+import { DeviceName } from '@shared/device';
+
interface ServerSectionProps {
state: IExtensionState | null;
@@ -46,6 +49,15 @@ export function ServerSection({ state }: ServerSectionProps): JSX.Element {
});
};
+ const handleDeviceChange = (deviceName: DeviceName) => {
+ vscode.postMessage({
+ type: SidePanelMessageTypes.DEVICE_CHANGE,
+ payload: {
+ deviceName,
+ },
+ });
+ };
+
if (!state) {
return <>Extension state is not available>;
}
@@ -64,6 +76,13 @@ export function ServerSection({ state }: ServerSectionProps): JSX.Element {
supportedFeatures={state.features.supportedList}
serverStatus={state.server.status}
>
+