pratikshahp commited on
Commit
2f98600
·
verified ·
1 Parent(s): c929f05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import os
2
  from dotenv import load_dotenv
3
  import gradio as gr
4
- from langchain_core.prompts import PromptTemplate
5
  from langchain_huggingface import HuggingFaceEndpoint
6
  from langchain_core.output_parsers import StrOutputParser
7
 
@@ -27,7 +27,7 @@ Make sure the blog post is informative, engaging, and well-structured.
27
  """
28
 
29
  # Create a prompt template instance
30
- blog_prompt_template = PromptTemplate(input_variables=["topic"], template=TEMPLATE)
31
 
32
  # Initialize the LLMChain with the HuggingFace model and prompt template
33
  blog_chain = blog_prompt_template | model | StrOutputParser()
 
1
  import os
2
  from dotenv import load_dotenv
3
  import gradio as gr
4
+ from langchain_core.prompts import PromptTemplate,ChatPromptTemplate
5
  from langchain_huggingface import HuggingFaceEndpoint
6
  from langchain_core.output_parsers import StrOutputParser
7
 
 
27
  """
28
 
29
  # Create a prompt template instance
30
+ blog_prompt_template = ChatPromptTemplate.from_template(input_variables=["topic"], template=TEMPLATE)
31
 
32
  # Initialize the LLMChain with the HuggingFace model and prompt template
33
  blog_chain = blog_prompt_template | model | StrOutputParser()