PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
11.93k stars 2.91k forks source link

[Question]: 使用SimpleServer部署taskflow服务,如何处理出参格式 #6020

Open TherChenYang opened 1 year ago

TherChenYang commented 1 year ago

请提出你的问题

`from paddlenlp import SimpleServer, Taskflow

cls = Taskflow("text_classification", task_path="./export", is_static_model=True) app = SimpleServer() app.register_taskflow("taskflow/cls", cls)` 现在使用SimpleServer部署,现在想调整下出参的格式,请问下该如何操作?

1649759610 commented 1 year ago

你好,参数格式不支持修改。可以考虑在拿到输出后,在simpleserver外层修改

TherChenYang commented 1 year ago

您好 服务启动后 我们是通过java调用http服务进行推理的 您说的”在simpleserver外层修改“可以实现在python层嘛 可否麻烦您提供一个例子