Coder Social home page Coder Social logo

Comments (4)

Restry avatar Restry commented on August 28, 2024 4

@chenhehong 谢谢,请问https://www.modelscope.cn/studios/damo/role_play_chat/files 这里面的roles_json和源码 有公开吗?想自己跑起来试一下

app_config.py 

import os
import json
import requests
class AppConfig(object):
    ALREADY_CONVERTED_MARK = "<!-- ALREADY CONVERTED BY PARSER. -->"

    with open(os.path.join(os.path.dirname(__file__), 'main.css'), "r", encoding="utf-8") as f:
        MAIN_CSS_CODE = f.read()
    
    roles_json = os.getenv('roles_json')
    print('roles json', roles_json)
    ROLES = json.loads(requests.get(roles_json).content.decode('utf-8'))

from chatplug.

chenhehong avatar chenhehong commented on August 28, 2024 1

你好,这个是代码支持cpu推理的bug,mass下一个sdk版本会修复该问题。
当前版本临时的解决方法是将 modelscope/pipelines/nlp/fid_dialogue_pipeline.py 文件194-195行中if torch.cuda.is_available(): hypotheses = inputs.sequences.detach().cpu().tolist()修改为hypotheses = inputs.sequences.detach().cpu().tolist()

from chatplug.

Restry avatar Restry commented on August 28, 2024

# 支持输入多段外部知识文本,进行知识增强
know_list = [
    "《狂飙》由徐纪周执导的。《狂飙》的导演徐纪周也是编剧之一,代表作品有《永不磨灭的番号》《特战荣耀》《心理罪之城市之光》《杀虎口》《胭脂》等",
    "《狂飙》(The Knockout)是一部由 张译、张颂文、李一桐、张志坚 领衔主演,韩童生 特邀主演,吴健、郝平 友情出演,高叶、贾冰、李健 主演,徐纪周 执导,朱俊懿、徐纪周 担任总编剧的 刑侦",
    "狂飙是由**政法委宣传教育局,**政法委政法信息中心指导,爱奇艺,留白影视出品,徐纪周执导,张译,李一桐,张志坚领衔主演的刑侦剧。不是。是徐纪周,1976年12月19日出生,毕业于**戏剧"
]

input = {
    "history": "你好[SEP]你好!很高兴与你交流![SEP]狂飙的导演是谁呀",
    "bot_profile": "我是达摩院的语言模型ChatPLUG, 是基于海量数据训练得到。",
    # 推理时,会根据[SEP]符号拆分为多段文本,分别和context合并后输入模型中,以节省计算量
    "knowledge": "[SEP]".join(know_list),
}

谢谢 @chenhehong 的回复,我还有几个剖一,不知道是不是可以帮忙回答,谢谢:

  • 官方示例中的 know_list 的知识增强最大支持多少内容? 我试过2w个字 64G的内存受不了了
  • 我如果想对本地知识库进行问答可以基于know_list做吗?
  • 我看到官方readme里面好像还能支持搜索引擎插件, 这个是如何实现的?

from chatplug.

chenhehong avatar chenhehong commented on August 28, 2024
  • 知识增强最大支持的token数和机器显存大小有关,我们的推理测试一般只用千级别的token数,2w个字64G应该吃不消
  • 本地知识库进行问答可以基于know_list>>可以
  • chatplug是调用夸克api接口实现的,该api接口是付费接口,暂时提供不了

from chatplug.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.