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

Commit

Permalink
[NeuralChat] Add test_mpt_trace.py (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liangyx2 authored Oct 30, 2023
1 parent 432060a commit 6446dab
Showing 1 changed file with 37 additions and 0 deletions.
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()

0 comments on commit 6446dab

Please sign in to comment.