This Streamlit application generates blogs using the LLAMA 2 language model. Users can specify the blog topic, desired word count, and target audience style. The app leverages LangChain and CTransformers to interface with the LLAMA 2 model and produce contextually relevant blog posts.
- User-Friendly Web Interface: Powered by Streamlit, allowing easy input of blog requirements.
- Model-Based Text Generation: Uses LLAMA 2 via CTransformers for high-quality blog content.
- Customizable Output: Choose topic, word count, and audience style (Researchers, Data Scientists, or Common People).
-
Input Fields:
- Blog Topic: Enter the subject of your blog.
- Number of Words: Specify the desired length.
- Blog Style: Select the target audience.
-
Blog Generation:
- The app constructs a prompt based on user input.
- It calls the LLAMA 2 model via LangChain’s CTransformers integration.
- The generated blog is displayed on the page.
- Python 3.7+
- Streamlit
- LangChain
- CTransformers
- LLAMA 2 model file (
.bin), path must be set in the code.
-
Clone the Repository
git clone https://github.com/kalpitrcc/LLM.git cd LLM -
Install Dependencies
pip install streamlit langchain ctransformers
-
Download LLAMA 2 Model
- Place the model file in the appropriate directory and update the path in
app.py:llm = CTransformers(model="path/to/llama-2-7b-chat.ggmlv3.q8_0.bin", ...)
- Place the model file in the appropriate directory and update the path in
Run the Streamlit app:
streamlit run app.pyOpen the provided local URL in your browser to access the blog generator.
- The model file path must be correct and accessible.
- Make sure all required packages are installed.
- The code assumes familiarity with LangChain and CTransformers.
This project is licensed under the MIT License.
