This is my submission for the LLM Hackathon 2023 organized by Streamlit.
Llamarizer is a text summarization bot, powered by the Llama2-13b model from Meta, on the Clarifai platform.
Python (at least 3.9.0) must be installed on your system.
After Python has been set up, install the virtualenv
package to create and manage a virtual environment for this project. This helps you maintain the project's dependencies in a hassle-free manner, without installing any unnecessary packages globally throughout your system.
pip install virtualenv
Clone this project to create a local copy of it on your system:
git clone "https://github.com/ravi-aratchige/llamarizer.git"
Then, move into the project folder:
cd llamarizer
Create a virtual environment inside the project folder to isolate its dependencies:
python -m venv env
# or
python3 -m venv env
Next, activate the virtual environment:
# on Windows:
.\env\Scripts\activate
# on MacOS or Linux
source env/bin/activate
You can deactivate this environment when you are done working with the project:
# on Windows, MacOS or Linux
deactivate
Set up your project with the necessary packages and libraries. After activating the virtual environment, enter the following command:
pip install -r requirements.txt
To store your Clarifai PAT (Personal Access Token) and other sensitive information, create a folder named .streamlit
within the project folder.
Next, create a file named secrets.toml
within that folder. Enter the following into that file:
PAT = "a-very-random-string-of-characters"
APP_ID = "foo"
USER_ID = "bar"
WORKFLOW_ID = "foo-bar"
- You can obtain your
PAT
from your Clarifai Account Settings. - The
APP_ID
is the unique ID of whatever app you have created and wish to connect to from your Streamlit app. - The
USER_ID
is simply your username. - The
WORKFLOW_ID
will be set up in the next step.
After you have created an app on the Clarifai platform and completed the above steps, create a new Workflow in that app.
Next, press "Edit workflow" to add the Llama2 model to the Workflow.
In the window that opens up, drag and drop a text-to-text
chip, connect it to the IN
node, and set the text-to-text
chip's model as one of the Llama2 models.
Finally, copy the name of the workflow and include it in the WORKFLOW_ID
of .streamlit/secrets.toml
that was created earlier.
After you have completed the above steps, you can start the Streamlit app.
streamlit run app.py
Streamlit will start up in localhost:8501
.
This project is licensed under the Apache License.