-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
316931b
commit 0c966d0
Showing
5 changed files
with
16 additions
and
19 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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
from modelscope_agent.tools.pipeline_tool import ModelscopePipelineTool | ||
from modelscope.utils.config import Config | ||
import os | ||
|
||
from modelscope_agent.tools import ModelscopePipelineTool | ||
|
||
from modelscope.utils.config import Config | ||
|
||
cfg = Config.from_file('config/cfg_tool_template.json') | ||
# 请用自己的SDK令牌替换{YOUR_MODELSCOPE_SDK_TOKEN}(包括大括号) | ||
os.environ['MODELSCOPE_API_KEY'] = f"{YOUR_MODELSCOPE_SDK_TOKEN}" | ||
os.environ['MODELSCOPE_API_KEY'] = f'{YOUR_MODELSCOPE_SDK_TOKEN}' | ||
|
||
|
||
def test_modelscope_speech_generation(): | ||
from modelscope_agent.tools.text_to_speech_tool import TexttoSpeechTool | ||
from modelscope_agent.tools import TexttoSpeechTool | ||
kwargs = """{'input': '北京今天天气怎样?', 'gender': 'man'}""" | ||
txt2speech = TexttoSpeechTool(cfg) | ||
res = txt2speech.call(kwargs) | ||
print(res) | ||
|
||
|
||
test_modelscope_speech_generation() | ||
|
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