mirror of
https://github.com/nextcloud/recognize.git
synced 2025-08-20 16:11:30 +00:00
Implement GPU mode
fixes #67 Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
@ -167,6 +167,20 @@ class AdminController extends Controller {
|
||||
return new JSONResponse(['wasmtensorflow' => true]);
|
||||
}
|
||||
|
||||
public function gputensorflow(): JSONResponse {
|
||||
try {
|
||||
exec($this->settingsService->getSetting('node_binary') . ' ' . __DIR__ . '/../../src/test_gputensorflow.js' . ' 2>&1', $output, $returnCode);
|
||||
} catch (\Throwable $e) {
|
||||
return new JSONResponse(['gputensorflow' => false]);
|
||||
}
|
||||
|
||||
if ($returnCode !== 0) {
|
||||
return new JSONResponse(['gputensorflow' => false]);
|
||||
}
|
||||
|
||||
return new JSONResponse(['gputensorflow' => true]);
|
||||
}
|
||||
|
||||
public function cron(): JSONResponse {
|
||||
$cron = $this->config->getAppValue('core', 'backgroundjobs_mode', '');
|
||||
return new JSONResponse(['cron' => $cron]);
|
||||
|
Reference in New Issue
Block a user