pydeoxy commited on
Commit
9274b84
·
verified ·
1 Parent(s): 0d9e617

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -14,11 +14,14 @@ llm = LlamaCpp(
14
  )
15
 
16
  # Generator function
17
- def gen_quiz(input, num):
18
  prompt = ChatPromptTemplate.from_template(
19
- "Generate {num} questions and their correct answers based on the following text:\n\n{text}\n\n")
 
 
 
20
  chain = LLMChain(llm=llm, prompt=prompt)
21
- quiz = chain.invoke(input)
22
  return quiz['text']
23
 
24
  # Example
 
14
  )
15
 
16
  # Generator function
17
+ def gen_quiz(text_input,num):
18
  prompt = ChatPromptTemplate.from_template(
19
+ "Generate {num} questions and their correct answers based on the following text:\n\n{text}\n\n"
20
+ )
21
+ # Prepare the inputs for the chain
22
+ prompt_input = {"text": text_input, "num": num}
23
  chain = LLMChain(llm=llm, prompt=prompt)
24
+ quiz = chain(prompt_input)
25
  return quiz['text']
26
 
27
  # Example