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

[NeuralChat] Add test_mpt_trace.py #538

Merged
merged 7 commits into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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()