Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 1a70da1

Browse files
committed
fix two parameters
Signed-off-by: Manxin Xu <manxin.xu@intel.com>
1 parent 16be033 commit 1a70da1

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

intel_extension_for_transformers/neural_chat/pipeline/plugins/retrieval/parser/context_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def get_relation(table_coords, caption_coords, table_page_number, caption_page_n
140140
table_summary = predict(**params)
141141
table_summary = table_summary[table_summary.find('### Generated Summary:\n'):]
142142
table_summary = re.sub('### Generated Summary:\n', '', table_summary)
143-
elif table_summary_mode == 'none':
143+
elif table_summary_mode == None:
144144
table_summary = None
145145
if table_summary is None:
146146
text = f'[Table: {content}]'

intel_extension_for_transformers/neural_chat/pipeline/plugins/retrieval/parser/parser.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ def load(self, input, **kwargs):
4949
self.min_chuck_size = kwargs['min_chuck_size']
5050
if 'process' in kwargs:
5151
self.process = kwargs['process']
52-
if 'table_summary_model_name_or_path' in kwargs:
53-
self.table_summary_model_name_or_path = kwargs['table_summary_model_name_or_path']
54-
self.table_summary_mode = kwargs['table_summary_mode'] if 'table_summary_mode' in kwargs else 'none'
52+
self.table_summary_model_name_or_path = kwargs['table_summary_model_name_or_path'] if 'table_summary_model_name_or_path' in kwargs else None
53+
self.table_summary_mode = kwargs['table_summary_mode'] if 'table_summary_mode' in kwargs else None
5554

5655
if isinstance(input, str):
5756
if os.path.isfile(input):

intel_extension_for_transformers/neural_chat/tests/ci/plugins/retrieval/test_parameters.py

-1
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,6 @@ def test_table_summary_none_mode(self):
785785
plugins.retrieval.args["input_path"] = "../assets/docs/LLAMA2_short.pdf"
786786
plugins.retrieval.args["persist_directory"] = "./table_summary_none_mode"
787787
plugins.retrieval.args["retrieval_type"] = 'default'
788-
plugins.retrieval.args["table_summary_mode"] = 'none'
789788
config = PipelineConfig(model_name_or_path="facebook/opt-125m",
790789
plugins=plugins)
791790
chatbot = build_chatbot(config)

0 commit comments

Comments
 (0)