You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 12, 2024. It is now read-only.
* Minor improvements (#16)
* Starting work on Jupyterlite build of icortex
* Changed metadata
* Minor
* Currently trying to fix jupyter_client import
* Kernel resources get installed
* Removed JupyterLite work for now because it's not as straightforward as expected
* Bumped to version 0.1.0 to conform standards
* Migrate prompt parsing to magic commands (#18)
* Replaced / and // with magic commands %p and %icortex
* Execute generated code with InteractiveShell.run_cell()
* Cell outputs are saved to ICortexHistory
* Minor
TODO: Prompts are given using the %prompt magic now, update the video accordingly
12
+
11
13
It is ...
12
14
13
-
- a drop-in replacement for the IPython kernel. Prompts start with a forward slash `/`—otherwise the line is treated as regular Python code.
15
+
- a drop-in replacement for the IPython kernel. Prompts can be executed with the [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html)`%prompt` or `%p` for short.
14
16
- an interface for [Natural Language Programming](https://en.wikipedia.org/wiki/Natural-language_programming) interface—prompts written in plain English automatically generate Python code which can then be executed globally.
15
17
- interactive—install missing packages directly, decide whether to execute the generated code or not, and so on, directly in the Jupyter Notebook cell.
16
18
- open source and fully extensible—if you think we are missing a model or an API, you can request it by creating an issue, or implement it yourself by subclassing `ServiceBase` under [`icortex/services`](icortex/services).
@@ -40,7 +42,7 @@ icortex init
40
42
Alternatively, you can initialize directly in a Jupyter Notebook ([instructions on how to start JupyterLab](https://jupyterlab.readthedocs.io/en/stable/getting_started/starting.html)):
41
43
42
44
```
43
-
//init
45
+
%icortex init
44
46
```
45
47
46
48
The shell will then instruct you step by step and create a configuration file `icortex.toml` in the current directory.
@@ -65,10 +67,10 @@ You can also try out different services e.g. OpenAI's Codex API, if you have acc
65
67
66
68
### Executing prompts
67
69
68
-
To execute a prompt with ICortex, use the `/` character (forward slash, also used to denote division) as a prefix. Copy and paste the following prompt into a cell and try to run it:
70
+
To execute a prompt with ICortex, use the `%prompt`[magic command](https://ipython.readthedocs.io/en/stable/interactive/magics.html) (or `%p` for short) as a prefix. Copy and paste the following prompt into a cell and try to run it:
69
71
70
72
```
71
-
/print Hello World. Then print the Fibonacci numbers till 100
73
+
%p print Hello World. Then print the Fibonacci numbers till 100
72
74
```
73
75
74
76
Depending on the response, you should see an output similar to the following:
@@ -87,7 +89,7 @@ Hello World.
87
89
You can also specify variables or options with command line flags, e.g. to auto-install packages, auto-execute the returned code and so on. To see the complete list of variables for your chosen service, run:
88
90
89
91
```
90
-
/help
92
+
%help
91
93
```
92
94
93
95
### Using ICortex CLI
@@ -106,7 +108,7 @@ icortex service help
106
108
107
109
### Accessing ICortex CLI inside Jupyter
108
110
109
-
You can still access the `icortex` CLI in a Jupyter Notebook or shell by using the prefix `//`. For example running the following in the terminal switches to a local HuggingFace model:
111
+
You can still access the `icortex` CLI in a Jupyter Notebook or shell by using the magic command `%icortex`. For example running the following in the terminal switches to a local HuggingFace model:
110
112
111
113
```
112
114
icortex service set huggingface
@@ -115,7 +117,7 @@ icortex service set huggingface
115
117
To do the same in a Jupyter Notebook, you can run
116
118
117
119
```
118
-
//service set huggingface
120
+
%icortex service set huggingface
119
121
```
120
122
121
123
in a cell, which initializes and switches to the new service directly in your Jupyter session.
0 commit comments