Summary of how to use ``Dalai'' that allows you to install chat AI ``LLaMA'' locally in one shot and try ``function to write continuation of sentences''



The language model '

LLaMA ' developed by Meta, the operator of Facebook and Instagram, has become a hot topic as it combines the ease of operating on a single GPU and the performance comparable to ChatGPT. `` Dalai '' that can easily operate `` llama . Saw.

dalai
https://cocktailpeanut.github.io/dalai/

To use Dalai, you need to install the JavaScript execution environment 'Node.js' and the developer tool pack 'Command Line Tools' first. This time, using iMac , install the necessary software in order. If you already have the environment, scroll down to Install & Launch Dalai .

·table of contents
◆1: Installing Node.js
◆2: Installing Command Line Tools
◆3: Install and start Dalai
◆ 4: I tried using LLaMA's 'function to write the continuation of the sentence' in Dalai

◆1: Install Node.js
First, click the link below to access the Node.js download page.

Node.js
https://nodejs.org/en/download/

Next, click 'macOS Installer' to download the installer (file size 70.4MB).



Then double-click the downloaded installer to launch it.



When the installer starts, click 'Continue'.



Read the license agreement carefully and click 'Continue'.



Click 'Agree'.



Click 'Install'.



Enter the password for logging in to the Mac and click 'Install software'.



Click OK when the following warning is displayed.



After waiting for a while, the installation will be completed, so click 'Close'.



Finally, click 'Move to Trash' to complete Node.js installation.



◆2: Installation of Command Line Tools
Next, install the developer tool pack 'Command Line Tools' provided by Apple. If you have Xcode installed, Command Line Tools are already installed, so you can skip this item.

First, press 'Command' and 'Space' to open Spotlight, search for 'Terminal', and launch it.



It is OK if the following screen opens.



Next, enter the following command and press 'Enter key (Return key)'.
[code]xcode-select --install[/code]



It looks like this when the image is shown. Copy and paste the above command as a whole and press 'Enter key' OK.



When the installation confirmation screen is displayed, click 'Install'.



Read the license agreement carefully and click 'I agree'.



The installation will take several minutes.



Click 'Finish' when the installation is completed. Now everything is ready for Dalai installation.



◆ 3: Install and start Dalai
Dalai can be installed simply by running the following command.
[code]npx dalai llama[/code]



It looks like this in the image.



Wait for a while as the download of the model data will proceed automatically.



The installation is complete when the following screen appears.



To start Dalai, run the following command.
[code]npx dalai serve[/code]



It looks like this in the image.



When 'Server running on http://localhost:3000' is displayed, start a browser such as Safari or Firefox.



After starting the browser, access '

http://localhost:3000 '.



Then, the Dalai UI is displayed as follows.



◆ 4: I tried using LLaMA's 'function to write the continuation of the sentence' in Dalai
In Dalai, you can generate the continuation of the entered sentence by entering the sentence in the text box and clicking 'Autocomplete'. Try 'I like cake.' Then click 'Autocomplete'.



Then, a sentence was generated that spoke passionately about how much they liked the cake. However, in the middle of the sentence, the ``sales pitch of the shelf that decorates the cake'' begins, and it cannot be said to be a very natural sentence.



Next, enter 'This is a pen.' Then click 'Autocomplete'.



This time, a commentary was generated for the mysterious product, 'A wonderful pen developed by Sanyo and Panasonic.'



I was worried about what would happen in Japanese, so enter 'Hello.' Then click 'Autocomplete'.



Then, the continuation of the sentence was generated in English. It seems that it does not correspond to sentence generation in Japanese.



The source code of Dalai is published at the following link.

GitHub - cocktailpeanut/dalai: The simplest way to run LLaMA on your local machine
https://github.com/cocktailpeanut/dalai



in Review,   Software, Posted by log1o_hf