mintaeng commited on
Commit
3f5331f
1 Parent(s): a1b6e91

Update pdfchatbot.py

Browse files
Files changed (1) hide show
  1. pdfchatbot.py +9 -4
pdfchatbot.py CHANGED
@@ -72,9 +72,14 @@ class PDFChatBot:
72
  Create a prompt template for the chatbot.
73
  """
74
  template = (
75
- f"The assistant should provide detailed explanations."
76
- "Combine the chat history and follow up question into "
77
- "Follow up question: What is this"
 
 
 
 
 
78
  )
79
  self.prompt = PromptTemplate.from_template(template)
80
 
@@ -116,7 +121,7 @@ class PDFChatBot:
116
  model=self.model,
117
  task='text-generation',
118
  tokenizer=self.tokenizer,
119
- max_new_tokens=200
120
  )
121
  self.pipeline = HuggingFacePipeline(pipeline=pipe)
122
 
 
72
  Create a prompt template for the chatbot.
73
  """
74
  template = (
75
+ """
76
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
77
+
78
+ ### Instruction: {question}
79
+
80
+ ### Response:
81
+
82
+ """
83
  )
84
  self.prompt = PromptTemplate.from_template(template)
85
 
 
121
  model=self.model,
122
  task='text-generation',
123
  tokenizer=self.tokenizer,
124
+ max_new_tokens=2048
125
  )
126
  self.pipeline = HuggingFacePipeline(pipeline=pipe)
127