Nasma's picture
Update app.py
405d419 verified
raw
history blame contribute delete
990 Bytes
import streamlit as st
from langchain.prompts import PromptTemplate
from langchain.llms import CTransformers
##function to get response from LLAma 2 model
def getLLamaresponse(input_text,no_words,blog_style):
##LLama 2model
st.set_page_config(page_title="Generate Blogs",
page_icon='πŸ™‚?',
layout='centered',
initial_sidebar_state='collapsed')
st.head("Generate Blogs πŸ™‚")
input_text=st.text_input("Enter the Blog Topic")
#creating 2more columns for additional 2 fields
col1,col2=st.columns([5,5])
with col1:
no_words=st.text_input('No of Words')
with col3:
blog_style=st.selectbox('Writing the blog for',
('Reseachers',
'Data Scientists',
'Common People'),
index=0)
submit=st.button("Generate")
##final response
if submit:
st.write(getLLamaresponse(input_text,no_words,blog_style))