Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,8 @@ def llm_response(user_text, number_of_words, blog_audience):
|
|
| 11 |
llm = ChatGoogleGenerativeAI(model="gemini-pro")
|
| 12 |
# define prompt template
|
| 13 |
ptemplate = '''
|
| 14 |
-
You are an Expert
|
| 15 |
-
write a
|
| 16 |
'''
|
| 17 |
prompt = PromptTemplate(template=ptemplate,input_variables=['user_text','number_of_words','blog_audience'])
|
| 18 |
final_prompt = prompt.format(user_text=user_text, number_of_words=number_of_words, blog_audience=blog_audience)
|
|
@@ -30,7 +30,7 @@ st.set_page_config(
|
|
| 30 |
initial_sidebar_state="collapsed",
|
| 31 |
)
|
| 32 |
|
| 33 |
-
st.header("
|
| 34 |
user_text = st.text_input("Enter title for blog")
|
| 35 |
col1,col2 = st.columns([6,6])
|
| 36 |
|
|
@@ -38,9 +38,9 @@ with col1:
|
|
| 38 |
number_of_words = st.text_input("Number of words in Blog")
|
| 39 |
|
| 40 |
with col2:
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
submit_btn = st.button("Submit")
|
| 46 |
|
|
|
|
| 11 |
llm = ChatGoogleGenerativeAI(model="gemini-pro")
|
| 12 |
# define prompt template
|
| 13 |
ptemplate = '''
|
| 14 |
+
You are an Expert Poem Writer. For the topic {user_text},
|
| 15 |
+
write a Poem in {number_of_words} words for children.
|
| 16 |
'''
|
| 17 |
prompt = PromptTemplate(template=ptemplate,input_variables=['user_text','number_of_words','blog_audience'])
|
| 18 |
final_prompt = prompt.format(user_text=user_text, number_of_words=number_of_words, blog_audience=blog_audience)
|
|
|
|
| 30 |
initial_sidebar_state="collapsed",
|
| 31 |
)
|
| 32 |
|
| 33 |
+
st.header("Poem Generation App🧊")
|
| 34 |
user_text = st.text_input("Enter title for blog")
|
| 35 |
col1,col2 = st.columns([6,6])
|
| 36 |
|
|
|
|
| 38 |
number_of_words = st.text_input("Number of words in Blog")
|
| 39 |
|
| 40 |
with col2:
|
| 41 |
+
# blog_audience = st.selectbox("Select target audience",
|
| 42 |
+
# ['Data Scientists', 'Researchers', 'Common People'],
|
| 43 |
+
# index=2)
|
| 44 |
|
| 45 |
submit_btn = st.button("Submit")
|
| 46 |
|