This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NeuralChat] Support microsoft/biogpt model as per the request (#1327)
* Support microsoft/biogpt model * add dependency --------- Signed-off-by: lvliang-intel <liang1.lv@intel.com>
- Loading branch information
1 parent
de88006
commit 3e7e353
Showing
9 changed files
with
75 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ pymysql | |
python-dotenv | ||
python-multipart | ||
rouge_score | ||
sacremoses | ||
shortuuid | ||
starlette | ||
tiktoken==0.4.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ pymysql | |
python-dotenv | ||
python-multipart | ||
rouge_score | ||
sacremoses | ||
shortuuid | ||
starlette | ||
torch==2.2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ pymysql | |
python-dotenv | ||
python-multipart | ||
rouge_score | ||
sacremoses | ||
shortuuid | ||
starlette | ||
torch==2.1.0a0 | ||
|
37 changes: 37 additions & 0 deletions
37
intel_extension_for_transformers/neural_chat/tests/nightly/models/test_biogpt.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (c) 2024 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 import build_chatbot, PipelineConfig | ||
import unittest | ||
|
||
class TestBioGPTModel(unittest.TestCase): | ||
def setUp(self): | ||
return super().setUp() | ||
|
||
def tearDown(self) -> None: | ||
return super().tearDown() | ||
|
||
def test_run_inference(self): | ||
config = PipelineConfig( | ||
model_name_or_path="/tf_dataset2/models/nlp_toolkit/biogpt") | ||
chatbot = build_chatbot(config=config) | ||
result = chatbot.predict("COVID-19 is ") | ||
print(result) | ||
self.assertIn('COVID-19 is', str(result)) and self.assertIn('pandemic', str(result)) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters