File size: 7,442 Bytes
b73cea4 5bafa5f b73cea4 5bafa5f b73cea4 5bafa5f b73cea4 5bafa5f b73cea4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
{
"cells": [
{
"cell_type": "markdown",
"id": "26b5a248",
"metadata": {},
"source": [
"## 4. Installing JupyterLab\n",
"\n",
"This class will show you how to interact with the Hugging Face API using the Python programming language. We'll run code directly in the notebooks online.\n",
"\n",
"### A few things to keep in mind:\n",
"- Each notebook contains code cells, like the one below. To execute the code, click on the cell, then click the play button at the top of the screen (or press `Ctrl + Enter`).\n",
"- The cells are structured logically, so run them one after another.\n",
"- You can’t break anything, so don’t be afraid to experiment with the cells.\n",
"- You’re working with temporary files, which means your work won’t be saved from one session to the next. If you want to keep your work, you can download your notebooks by clicking **File > Download**.\n",
"\n",
"For those who prefer to run the notebooks on Google Colab, you can [download them here](https://huggingface.co/spaces/JournalistsonHF/first-llm-classifier/tree/main/notebooks).\n",
"\n",
"If you want to run it on your computer, you can write Python code in your terminal, in a text file and any number of other places. If you’re a skilled programmer who already has a preferred venue for coding, feel free to use it as you work through this class.\n",
"\n",
"If you’re not, the tool we recommend for beginners is [Project Jupyter](http://jupyter.org/), a browser-based interface where you can write, run, remix, and republish code.\n",
"\n",
"> ⚠️ Note: This step is optional. We’ll be running all code directly in JupyterLab on Hugging Face. Follow this step only if you prefer to run the code on your local machine—otherwise, you can skip to the next step.\n",
"\n",
"It is free software that anyone can install and run. It is used by [scientists](http://nbviewer.jupyter.org/github/robertodealmeida/notebooks/blob/master/earth_day_data_challenge/Analyzing%20whale%20tracks.ipynb), [scholars](http://nbviewer.jupyter.org/github/nealcaren/workshop_2014/blob/master/notebooks/5_Times_API.ipynb), [investors](https://github.com/rsvp/fecon235/blob/master/nb/fred-debt-pop.ipynb), and corporations to create and share their research. It is also used by journalists to develop stories and show their work.\n",
"\n",
"The easiest way to use it is by installing [JupyterLab Desktop](https://github.com/jupyterlab/jupyterlab-desktop), a self-contained application that provides a ready-to-use Python environment with several popular libraries bundled in. \n",
"\n",
"It can be installed on any operating system with a simple point-and-click interface."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "c97c32a7-0497-4231-a628-647afdaac68b",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<div style=\"position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%;\">\n",
" <iframe \n",
" src=\"https://www.youtube.com/embed/578B63wZ7rI\" \n",
" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%;\" \n",
" frameborder=\"0\" \n",
" allowfullscreen>\n",
" </iframe>\n",
"</div>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.display import HTML\n",
"\n",
"HTML(\"\"\"\n",
"<div style=\"position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%;\">\n",
" <iframe \n",
" src=\"https://www.youtube.com/embed/578B63wZ7rI\" \n",
" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%;\" \n",
" frameborder=\"0\" \n",
" allowfullscreen>\n",
" </iframe>\n",
"</div>\n",
"\"\"\")"
]
},
{
"cell_type": "markdown",
"id": "d5decd99-55a2-4a56-b88f-1930a6245203",
"metadata": {},
"source": [
"The first step is to visit [JupyterLab Desktop’s homepage on GitHub](https://github.com/jupyterlab/jupyterlab-desktop) in your web browser. \n",
"\n",
"\n",
"\n",
"Scroll down to the documentation below the code until you reach the [Installation](https://github.com/jupyterlab/jupyterlab-desktop) section. \n",
"\n",
"\n",
"\n",
"Then pick the link appropriate for your operating system. The installation file is large, so the download might take a while.\n",
"\n",
"Find the file in your downloads directory and double-click it to begin the installation process. \n",
"\n",
"Follow the instructions presented by the pop-up windows, sticking to the default options.\n",
"\n",
"> ⚠️ **Warning** \n",
"> Your computer’s operating system might flag the JupyterLab Desktop installer as an unverified or insecure application. Don’t worry. The tool has been vetted by Project Jupyter’s core developers and it’s safe to use. \n",
"> If your system is blocking you from installing the tool, you’ll likely need to work around its barriers. For instance, on macOS, this might require [visiting your system’s security settings](https://www.wikihow.com/Install-Software-from-Unsigned-Developers-on-a-Mac) to allow the installation.\n",
"\n",
"Once JupyterLab Desktop is installed, you can accept the installation wizard’s offer to immediately open the program, or you can search for “Jupyter Lab” in your operating system’s application finder.\n",
"\n",
"That will open up a new window that looks something like this:\n",
"\n",
"\n",
"\n",
"> ⚠️ **Warning** \n",
"> If you see a warning bar at the bottom of the screen that says you need to install Python, click the link provided to make that happen.\n",
"\n",
"Click the “New notebook…” button to open the Python interface.\n",
"\n",
"\n",
"\n",
"Welcome to your first Jupyter notebook. Now you’re ready to move on to writing code.\n",
"\n",
"> 💡 **Note** \n",
"> If you’re struggling to make Jupyter work and need help with the basics, \n",
"> we recommend you check out [“First Python Notebook”](https://palewi.re/docs/first-python-notebook/), where you can get up to speed.\n",
"\n",
"**[5. Prompting with Python →](ch5-prompting-with-python.ipynb)**"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cca91757-438f-4a5f-b3d5-2bdd774278de",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|