Skip to content

Commit

Permalink
refs #1 : add - support for GNU octave, Theano and Keras environment
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Feb 8, 2017
1 parent 8c061d7 commit 8247604
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ Visual Studio Code extension to run code snippets via Sorna Cloud API server (ht

## Requirements

### Supported Language on Sorna Cloud
### Supported Languages / frameworks on Sorna Cloud

* Python 2.7
* Python 3.6
* TensorFlow 0.12
* Theano 0.8
* Keras 1.2
* PHP 7
* Javascript (via V8 engine)
* Node.js 4
* R 3
* Octave 4.2
* Julia
* haskell
* Lua 5

### Languages (to be ready soon)

* Octave 4
* Rust
* Swift (via Swift opensource version)
* Theano
* Caffe
* Keras
* C++ (via gcc)

## How-to
Expand Down
47 changes: 27 additions & 20 deletions src/live-code-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,27 +159,34 @@ export class LiveCodeRunner {
grammar = null;
}
if (grammar) {
let kernelName;
let grammarName = (grammar || grammar.scopeName).toLowerCase();
switch (grammarName) {
case "python":
let code = editor.document.getText();
if (code.search("tensorflow") > 0) {
kernelName = "tensorflow-python3-gpu";
} else {
kernelName = "python3";
let kernelName;
let grammarName = (grammar || grammar.scopeName).toLowerCase();
switch (grammarName) {
case "python":
let code = editor.document.getText();
if (code.search("tensorflow") > 0) {
kernelName = "tensorflow-python3-gpu";
} else if (code.search("keras") > 0) {
kernelName = "tensorflow-python3-gpu";
} else if (code.search("theano") > 0) {
kernelName = "python3-theano";
} else if (code.search("caffe") > 0) {
kernelName = "python3-caffe";
} else {
kernelName = "python3";
}
break;
case "r": kernelName = "r3"; break;
case "julia": kernelName = "julia"; break;
case "lua": kernelName = "lua5"; break;
case "php": kernelName = "php7"; break;
case "haskell": kernelName = "haskell"; break;
case "matlab": case "octave": kernelName = "octave4"; break;
case "nodejs": case "javascript": kernelName = "nodejs4"; break;
default: kernelName = null;
}
break;
case "r": kernelName = "r3"; break;
case "julia": kernelName = "julia"; break;
case "lua": kernelName = "lua5"; break;
case "php": kernelName = "php7"; break;
case "haskell": kernelName = "haskell"; break;
case "nodejs": case "javascript": kernelName = "nodejs4"; break;
default: kernelName = null;
}
console.log(`Kernel Language: ${kernelName}`);
return kernelName;
console.log(`Kernel Language: ${kernelName}`);
return kernelName;
}
}

Expand Down

0 comments on commit 8247604

Please sign in to comment.