Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuyatinnefeld/llama-2
📕 Llama 2 Python Project 📕
https://github.com/yuyatinnefeld/llama-2
llama2 python
Last synced: 5 days ago
JSON representation
📕 Llama 2 Python Project 📕
- Host: GitHub
- URL: https://github.com/yuyatinnefeld/llama-2
- Owner: yuyatinnefeld
- Created: 2023-07-23T14:55:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-23T17:19:31.000Z (over 1 year ago)
- Last Synced: 2024-10-18T21:59:14.022Z (3 months ago)
- Topics: llama2, python
- Language: Jupyter Notebook
- Homepage:
- Size: 274 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LLAMA-2 API + Python / JupyterLab
## Source
- https://huggingface.co/docs/transformers/main_classes/text_generation## Setup Workspace Environments
1. register by meta to download the model
- https://ai.meta.com/resources/models-and-libraries/llama-downloads/
2. Create a Hugging Face Account
- site: https://huggingface.co/3. Create a HF Token
- HuggieFace -> Settings -> Access Token > Create
![Screenshot](/img/hf-token.png)5. install python packages
```bash
pip install -r requirements.txt
python -m pip install --upgrade transformers
```6. Test the Token
```bash
huggingface-cli login
```7. Request Llama-2 model access
- site: https://huggingface.co
- model: meta-llama/Llama-2-7b-chat-hf
- action: Request Submit
- It may take a day to get access8. Receive the permission notification by Email
## Run Llama 2 in JupyterLab
1. install packages
```bash
pip install -r requirements.txt
```2. start jupyter lab
```bash
jupyter lab
```3. Open Notebook
```bash
cd notebook/step-1.ipynb
```4. Login to HF to get access to the model
![Screenshot](/img/login-hf.png)
5. Execute scripts in Notebook
- step-1.ipynb
- step-2.ipynb## Run Llama 2 in your IDE
1. Login HuggingFace
```bash
huggingface-cli login
```2. install packages
```bash
pip install -r requirements.txt
```
3. download model
```bash
python src/main.py
```