Spaces:
Sleeping
Sleeping
Download app.py from Nasma/BlogGenerationApp: direct link, hf CLI and curl.
- Browser
- Download file 990 Bytes
-
https://huggingface.co/spaces/Nasma/BlogGenerationApp/resolve/main/app.py
- Command line
-
hf download hf://spaces/Nasma/BlogGenerationApp/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Nasma/BlogGenerationApp/resolve/main/app.py
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)) | |