Spaces:
Sleeping
Sleeping
Update pdfchatbot.py
Browse files- 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 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
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=
|
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 |
|