gpt4 book ai didi

python - Flasgger - 上传文件

转载 作者:太空宇宙 更新时间:2023-11-03 10:54:02 28 4
gpt4 key购买 nike

我正在做一个需要通过 flasgger UI 上传文件的项目。我根据 Swagger 文档修改了我的 conf,但似乎不起作用。下面是我的 session 。请告知错误。

"""
This API let's you train word embeddings
Call this api passing your file and get the word embeddings.

---
tags:
- Train (Word Embeddings)
consumes:
- multipart/form-data
parameters:
- in: formData
name: body
required: true
description: Upload your file.
responses:
500:
description: ERROR Failed!
200:
description: INFO Success!
schema:
$ref: '#/definitions/txt_embeddings'
"""

最佳答案

您缺少“类型:文件”,以下对我有用:

...
parameters:
- name: file
required: false
in: formData
type: file
...

关于python - Flasgger - 上传文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44950908/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com