Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ The Questions (answer each QUESTION 3 times in listicle format according to the
|
|
| 21 |
st.title("Marketing Teachnology")
|
| 22 |
|
| 23 |
prompt = PromptTemplate(
|
| 24 |
-
input_variables = ["
|
| 25 |
template=mini_template,
|
| 26 |
)
|
| 27 |
|
|
@@ -32,14 +32,14 @@ chain = LLMChain(llm=OpenAI(), prompt=prompt)
|
|
| 32 |
|
| 33 |
# Use the sidebar for input
|
| 34 |
target_audience = st.sidebar.text_input("Enter your target audience")
|
| 35 |
-
my_course = st.sidebar.text_input("Enter your course name")
|
| 36 |
|
| 37 |
if st.sidebar.button("Get response"):
|
| 38 |
if target_audience and my_course:
|
| 39 |
with st.spinner("Generating response..."):
|
| 40 |
with st.expander("Show prompt", expanded=False):
|
| 41 |
st.info(prompt.template)
|
| 42 |
-
answer = chain.run({"
|
| 43 |
|
| 44 |
# Split the 'answer' into sections based on the questions
|
| 45 |
sections = [section.strip() for section in answer.split("\n\n") if section.strip() != ""]
|
|
|
|
| 21 |
st.title("Marketing Teachnology")
|
| 22 |
|
| 23 |
prompt = PromptTemplate(
|
| 24 |
+
input_variables = ["target_audience", "target_course"],
|
| 25 |
template=mini_template,
|
| 26 |
)
|
| 27 |
|
|
|
|
| 32 |
|
| 33 |
# Use the sidebar for input
|
| 34 |
target_audience = st.sidebar.text_input("Enter your target audience")
|
| 35 |
+
my_course = st.sidebar.text_input("Enter your course/service name")
|
| 36 |
|
| 37 |
if st.sidebar.button("Get response"):
|
| 38 |
if target_audience and my_course:
|
| 39 |
with st.spinner("Generating response..."):
|
| 40 |
with st.expander("Show prompt", expanded=False):
|
| 41 |
st.info(prompt.template)
|
| 42 |
+
answer = chain.run({"target_audience": target_audience, "target_course": my_course})
|
| 43 |
|
| 44 |
# Split the 'answer' into sections based on the questions
|
| 45 |
sections = [section.strip() for section in answer.split("\n\n") if section.strip() != ""]
|