Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RexUniNLU模型多线程调用报错 #846

Open
zhangkesheng opened this issue Apr 28, 2024 · 0 comments
Open

RexUniNLU模型多线程调用报错 #846

zhangkesheng opened this issue Apr 28, 2024 · 0 comments
Assignees

Comments

@zhangkesheng
Copy link

import time

from fastapi import FastAPI
from modelscope.pipelines import pipeline
from pydantic import BaseModel

semantic_cls = pipeline('rex-uninlu',
                        model='damo/nlp_deberta_rex-uninlu_chinese-base',
                        model_revision='v1.2.1')

app = FastAPI()


class Item(BaseModel):
    input: str
    fields: object


@app.post("/damo/rex-uninlu")
def uie(item: Item):
    start = time.time()
    return {
        'data': semantic_cls(input=item.input, schema=item.fields),
        'took': time.time() - start
    }

用FastAPI对外提供了接口, 在阿里云FC里部署, 实例并发度10, 多线程调用的时候就会出现下面的报错
图片
Pipeline related: @Firmament-cyou @wenmengzhou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants