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.
Make ICortex work on Google Colab, doc improvements (#29)
* Improve history format
* Wip
* Improved docs, config init
* Updated dependencies to work with Python 3.7 (used by google colab)
* Undid output capturing for now
> *Soft program:* a set of instructions (i.e. prompts) [written in natural language](https://en.wikipedia.org/wiki/Natural-language_programming) (e.g. English), processed by a language model that generates code at a lower layer of abstraction (e.g. Python), to perform work more flexibly than regular software.
25
+
26
+
In other words, ICortex is a **natural language programming** (NLP) framework that enables you to write code in English, and then run it in Python. It aims to make programming more accessible to non-programmers.
28
27
29
-
ICortex is ...
28
+
ICortex is designed to be …
30
29
31
-
- 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.
32
-
- interactive—install missing packages directly, decide whether to execute the generated code or not, and so on, directly in the Jupyter Notebook cell.
33
-
- 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).
30
+
- a drop-in replacement for the [IPython kernel](https://ipython.org/). Prompts are executed via [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html)such as`%prompt`.
31
+
- interactive—automatically install missing packages, decide whether to execute the generated code or not, and so on, directly in the Jupyter Notebook cell.
32
+
- open source and fully extensible—ICortex introduces a [domain-specific language](https://en.wikipedia.org/wiki/Domain-specific_language) for orchestrating various code generation services. 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).
34
33
35
-
It is similar to [Github Copilot](https://github.com/features/copilot) but with certain differences that make it stand out:
34
+
ICortex is similar to [Github Copilot](https://github.com/features/copilot) but with certain differences that make it stand out:
36
35
37
36
| Feature | GitHub Copilot | ICortex |
38
37
|---|:---:|:---:|
@@ -48,6 +47,8 @@ ICortex is currently in alpha, so expect breaking changes. We are giving free cr
48
47
49
48
## Installation
50
49
50
+
### Locally
51
+
51
52
Install directly from PyPI:
52
53
53
54
```sh
@@ -56,6 +57,15 @@ pip install icortex
56
57
python -m icortex.kernel.install
57
58
```
58
59
60
+
### On Google Colab
61
+
62
+
[Google Colab](https://colab.research.google.com/) is a restricted computing environment that does not allow installing new Jupyter kernels. However, you can still use ICortex by running the following code in a Colab notebook:
63
+
64
+
```
65
+
!pip install icortex
66
+
import icortex.init
67
+
```
68
+
59
69
## Quickstart
60
70
61
71
[Click here to visit the docs and get started using ICortex](https://icortex.readthedocs.io/en/latest/quickstart.html).
- sets of instructions (i.e. prompts) `written in natural
15
-
language <https://en.wikipedia.org/wiki/Natural-language_programming>`__
16
-
(such as English)
17
-
- processed by language models that generate Python code
18
-
- to perform useful work in various contexts
19
-
- more flexibly than regular software.
14
+
ICortex enables you to develop **soft programs**:
20
15
21
-
To put it simply—in goes English, out comes Python:
16
+
*Soft program:* a set of instructions (i.e. prompts) `written in natural language <https://en.wikipedia.org/wiki/Natural-language_programming>`__ (e.g. English), processed by a language model that generates code at a lower layer of abstraction (e.g. Python), to perform work more flexibly than regular software.
In other words, ICortex is a **natural language programming** (NLP) framework that enables you to write code in English, and then run it in Python. It aims to make programming more accessible to non-programmers.
25
19
26
-
ICortex is …
20
+
ICortex is designed to be …
27
21
28
-
- a drop-in replacement for the IPython kernel. Prompts can be executed
29
-
with the `magic
22
+
- a drop-in replacement for the `IPython kernel<https://ipython.org/>`__. Prompts can be executed
- open source and fully extensible—ICortex introduces a `domain-specific language <https://en.wikipedia.org/wiki/Domain-specific_language>`__ for orchestrating various code generation services. 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 <https://github.com/textcortex/icortex/tree/main/icortex/services>`__.
Copy file name to clipboardExpand all lines: docs/source/quickstart.rst
+33-20Lines changed: 33 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,10 @@ Quickstart
5
5
Installation
6
6
------------
7
7
8
-
Install ICortex from PyPI, along with JupyterLab:
8
+
Locally
9
+
~~~~~~~
10
+
11
+
Install ICortex on your local machine, along with JupyterLab:
9
12
10
13
.. code:: sh
11
14
@@ -18,15 +21,37 @@ The second line is needed to install the kernel spec into Jupyter, otherwise, yo
18
21
19
22
jupyter kernelspec list
20
23
21
-
ICortex should be visible in the list of available kernels.
24
+
ICortex needs to be visible in the list of available kernels.
25
+
26
+
On Google Colab
27
+
~~~~~~~~~~~~~~~
28
+
29
+
`Google Colab <https://colab.research.google.com/>`__ is a restricted computing environment that does not allow installing new Jupyter kernels. However, you can still use ICortex by running the following code in a Colab notebook:
30
+
31
+
.. code:: text
32
+
33
+
!pip install icortex
34
+
import icortex.init
22
35
23
36
Using ICortex
24
37
-------------
25
38
39
+
Create a TextCortex account
40
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
41
+
42
+
.. tip::
43
+
**This does not require you to enter any payment information.** Your account will receive free credits to try out the service. If you already have an account, you can skip this step.
44
+
45
+
46
+
You need a TextCortex account to connect to TextCortex's code generation API. If you are planning to use a different code generation service, you can skip to :ref:`Start JupyterLab`.
47
+
48
+
|signup_link|
49
+
50
+
Once you have an account, proceed to the next section.
51
+
26
52
Start JupyterLab
27
53
~~~~~~~~~~~~~~~~
28
54
29
-
30
55
Create a directory for your new project, and start JupyterLab:
31
56
32
57
::
@@ -35,7 +60,7 @@ Create a directory for your new project, and start JupyterLab:
35
60
cd new-icortex-project/
36
61
jupyter lab
37
62
38
-
Once JupyterLab is up and running, create a new notebook that uses ICortex.
63
+
Once JupyterLab is up and running, create a new notebook with ICortex kernel. If you are using Google Colab, you can skip this step.
39
64
40
65
.. important::
41
66
If you don't see ICortex in the list of available kernels, you may have skipped kernel installation above—run ``python -m icortex.kernel.install`` and restart JupyterLab. If you still don't see ICortex there, `create a new installation issue on GitHub <https://github.com/textcortex/icortex/issues/new>`__.
@@ -60,11 +85,11 @@ After running ``%icortex init`` you should see the following message:
60
85
::
61
86
62
87
Which code generation service would you like to use?
63
-
Variables: textcortex, huggingface, openai
64
-
Default [textcortex]
88
+
Available services: textcortex, huggingface, openai
89
+
Default: textcortex (Press enter to select the default option)
65
90
66
91
67
-
ICortex supports different code generation services such as the TextCortex API, OpenAI Codex API, local HuggingFace transformers, and so on. We recommend that you start with TextCortex. It is already selected by default—**press Enter once** to move on to the next step.
92
+
ICortex supports different code generation services. We recommend that you start with TextCortex. It is selected by default—**press Enter once** to move on to the next step.
68
93
69
94
In the next step, the dialog will ask whether to use the default parameters for TextCortex's code generation service:
70
95
@@ -80,18 +105,6 @@ In the next step, the dialog will ask whether to use the default parameters for
Do not type anything yet, and proceed to the next section.
84
-
85
-
Create a TextCortex account
86
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
87
-
88
-
You need a TextCortex account to connect to TextCortex's code generation API.
89
-
90
-
|signup_link|.
91
-
92
-
.. note::
93
-
This does not require you to enter any payment information and your account will receive free credits to try out the service. If you already have an account, you can skip this step.
94
-
95
108
Next, |api_key_link|.
96
109
97
110
Copy your API key from the dashboard, go back to the Jupyter notebook where you initially ran ``%icortex init``, and paste it in the dialog where it was asked for. Press Enter to continue.
@@ -192,7 +205,7 @@ ICortex printed the code generated by the API and is now asking whether it shoul
192
205
193
206
.. |signup_link| raw:: html
194
207
195
-
<a href="https://app.textcortex.com/user/signup" target="_blank">Click here sign up on the website</a>
208
+
<blockquote><div style="text-align: center"><p><a href="https://app.textcortex.com/user/signup?registration_source=icortex" target="_blank">Click here sign up at TextCortex</a></p></div></blockquote>
0 commit comments