From 6446dab2fb2c610dd0193339e270bae0067c544a Mon Sep 17 00:00:00 2001 From: Liangyx2 Date: Mon, 30 Oct 2023 09:35:04 +0800 Subject: [PATCH] [NeuralChat] Add test_mpt_trace.py (#538) --- .../neural_chat/tests/api/test_mpt_trace.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 intel_extension_for_transformers/neural_chat/tests/api/test_mpt_trace.py diff --git a/intel_extension_for_transformers/neural_chat/tests/api/test_mpt_trace.py b/intel_extension_for_transformers/neural_chat/tests/api/test_mpt_trace.py new file mode 100644 index 00000000000..0c698eaef88 --- /dev/null +++ b/intel_extension_for_transformers/neural_chat/tests/api/test_mpt_trace.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright (c) 2023 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from intel_extension_for_transformers.neural_chat.config import AMPConfig +from intel_extension_for_transformers.neural_chat import build_chatbot, PipelineConfig +import unittest + +class TestMptTrace(unittest.TestCase): + def setUp(self): + return super().setUp() + + def tearDown(self) -> None: + return super().tearDown() + + def test_mpt_trace(self): + config = PipelineConfig(optimization_config=AMPConfig(), model_name_or_path='/models/mpt-7b-chat') + chatbot = build_chatbot(config) + response = chatbot.predict(query="hello") + self.assertIsNotNone(response) + + +if __name__ == "__main__": + unittest.main()