File size: 759 Bytes
4332706
bf0c209
4332706
 
8815611
4332706
bf0c209
 
 
 
 
 
 
 
 
 
 
 
021ab97
4332706
 
 
bf0c209
021ab97
bf0c209
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import streamlit as st
from langchain.llms import OpenAI

st.set_page_config(page_title="Instagram Quote Developer")
st.header("INSTAGRAM QUOTES DEVELOPER")

chat=OpenAI(model_name="text-davinci-003")

def get_text():
    input_string=st.text_input("Write your description",key="input")
    input_number=st.text_input("Mention the number of words for your quote")
    return input_string,input_number

def get_response(text,number):
    template=f"""{text}Create an instagram quote to post with pictures for the above text in {number} words
    """
    return chat(template)

input_text,number=get_text()

submit=st.button("Generate Quote")

if submit:
    response=get_response(input_text,number)
    st.subheader("Instagram Quote:")
    st.write(response)