-
Llama 2 is licensed under the LLAMA 2 Community License, Copyright (c) Meta Platforms, Inc. All Rights Reserved.
-
The project is a final project for NYCU CS AI course.
- It's a project that can analysis the hot comments of the steam game.
- By clicking down a game name in UI, this program will automatically search the top comments of the game, and llama will organize top comments as a brief summerization.
- If you want to know whether a game is good or not, but you don't rely on the grading, besides, you don't want to look reviews one by one. This program is extraordinary suit for you.
- programming language
- We are recommend to use
python 3.10
or higher.
- We are recommend to use
- packages
- clone this project from GitHub, which means you run following command in your terminal,
git clone https://github.com/Mushroom-MSL1L/NYCU-AI-Final-Project-STEAM.git
- cd to this folder
NYCU-AI-Final-Project-STEAM
- run
pip install -r requirements.txt
- clone this project from GitHub, which means you run following command in your terminal,
- model
- This repo do not provide model, you need to download a one.
- Make a folder whose name is
llama.cpp
underModel
folder. And cd tollama.cpp
folder. - Download
llama-2-7B.Q4_k_M model
asgguf
file by running this commandhuggingface-cli download TheBloke/Llama-2-7b-Chat-GGUF llama-2-7b-chat.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
- Rename the file name as
llama-2-7b-chat.Q4_K_M.gguf
if needed. - There should has a path like
NYCU-AI-Final-Project-STEAM\Model\llama.cpp\llama-2-7b-chat.Q4_K_M.gguf
- More information can take a look at
supplement.md
.
- make sure your current folder is
NYCU-AI-Final-Project-STEAM
. - run
chainlit run ui.py -w
in terminal - open your browser and go to
http://localhost:8000
- Type one game name you want to analysis
- we recommend below games to test
- "Cyberpunk 2077"
- "Forza Horizon 4"
- "Forza Horizon 5"
- "The Witcher 3: Wild Hunt"
- get more games from
game_list.txt
- we recommend below games to test
- wait for a while, you will see the result.
- Upload
STEAM.ipynb
to google Colab notebook. - Run the code one by one in the notebook.
Download llm model
part may need 30 secondsllama-cpp-python GPU ver. install
part may need 20 minutes
- In
Run
part you need to updateadd-authtoken
with your own token.- go to ngrok and sign up.
- get your token from your-authtoken
- Just press the
copy
button and paste it to the code. - like
!ngrok config add-authtoken 2hYXWxSKTePaAIU6Xb86s9EJgYa_53qzsH6jSz88QHBaKt4Ad
- Keep run the remaining code, until it shows
http://localhost:8000
.
- Click the link
http://localhost:8000
in the output. - Type one game name you want to analysis
- we recommend below games to test
- "Cyberpunk 2077"
- "Forza Horizon 4"
- "Forza Horizon 5"
- "The Witcher 3: Wild Hunt"
- get more games from
game_list.txt
- we recommend below games to test
- wait for a while, you will see the result.
In class LLM
, you are able to change some parameter in self.config
.
max_token
: model terminates its output as it reaches the max token.n_ctx
: context window, input length for the llm. Here are the parameters for both the GPU and the CPU.n_batch
: batch size for the model. Here are the parameters for both the GPU and the CPU.n_gpu_layers
: num of gpu_layers for the model. Available only for GPU.
In class chain
in chain.py you are able to change some parameters in self.config
.
keywords
:- keywords for retrieving. But, you have to concider the max token of input if you add more.
total_document_length
:- For max total_document tokens in prompt.
total_document_length + template_prompt (approx. 40 words)
cannot exceedn_ctx
inModel/LLM
- For max total_document tokens in prompt.
max_docs_length
:- For max document length for each document in prompt.
max_docs_length * num_of_keywords
must less thantotal_document_length
at least.
- For max document length for each document in prompt.
add_review_number
:- the number of review you want to add in vectordatabse for each games.
Thanks goes to these wonderful people (emoji key):
Lu Junyou 💻 🐛 ✅ 👀 |
WilsonNYCU 📢 💻📹 |
Kennethii2i 💻 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!