Amirizaniani commited on
Commit
5bb0fac
1 Parent(s): 4abaacb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,9 +1,11 @@
1
  import gradio as gr
2
- from langchain import PromptTemplate, LLMChain
3
  from langchain.llms import CTransformers
 
 
4
 
5
  def generate_prompts(user_input):
6
- prompt_template = PromptTemplate(
7
  input_variables=["Question"],
8
  template=f"Just list 10 quetion prompts for {user_input} and don't put number before each of the prompts."
9
  )
@@ -22,7 +24,7 @@ def generate_prompts(user_input):
22
  return questions_list
23
 
24
  def answer_question(prompt):
25
- prompt_template = PromptTemplate(
26
  input_variables=["Question"],
27
  template=f"give one answer for {prompt} and do not consider the number behind it."
28
  )
 
1
  import gradio as gr
2
+ from langchain import LLMChain
3
  from langchain.llms import CTransformers
4
+ from langchain_core.prompts import PromptTemplate
5
+
6
 
7
  def generate_prompts(user_input):
8
+ prompt_template = PromptTemplate.from_template(
9
  input_variables=["Question"],
10
  template=f"Just list 10 quetion prompts for {user_input} and don't put number before each of the prompts."
11
  )
 
24
  return questions_list
25
 
26
  def answer_question(prompt):
27
+ prompt_template = PromptTemplate.from_template(
28
  input_variables=["Question"],
29
  template=f"give one answer for {prompt} and do not consider the number behind it."
30
  )