Skip to main content

Vines Python 训练项目 SDK (供内部使用)

Project description

Vines Python 训练项目 SDK (供内部使用)

这个项目希望解决的问题,将开发一个新的训练项目中的很多重复性工作进行统一封装:

  1. 每次开一个新训练项目都需要起 HTTP Server
  2. 里面有可能会用到很多通用能力,比如上传、下载文件、以及一些基础方法等,这些都应该封装好。
  3. 错误日志推送逻辑
  4. 运行时日志逻辑
  5. api 入参、出参统一格式封装
  6. 统一的日志格式、日志收集

安装

pip install vines-infer-sdk

使用示例

作为 conductor 客户端

详情见 exampels/example_conductor.py 文件中的内容。

使用 flask http server

lib.server 引入 create_server 方法,初始化 flask app,参数:

  • sentry_dsn: sentry dsn, 如果配置,会自动收集异常推送到 sentry
  • log_redis_queue_url: 如果配置,在调用 request.logger 方法的时候,会自动推送到消息队列,从而给前端展示。

打印日志的方法:直接使用 request.logger 实例的方法。

详情见 exampels/example_server.py 文件中的内容。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vines_infer_sdk-0.0.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vines_infer_sdk-0.0.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file vines_infer_sdk-0.0.2.tar.gz.

File metadata

  • Download URL: vines_infer_sdk-0.0.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for vines_infer_sdk-0.0.2.tar.gz
Algorithm Hash digest
SHA256 56326c772d85a202d7bd58e80e7f89c18f274f470e67626495af0c4843d2f748
MD5 65a978ec954925151d5e957fbeef715b
BLAKE2b-256 8b1572488d635935b58fc61fd8d7ada42fa3a1774d374e887a0093cf0a0cb99b

See more details on using hashes here.

File details

Details for the file vines_infer_sdk-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for vines_infer_sdk-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 950ee2de7e7b4c70fdd6186348c05570eb4ab163435d0f8ccb76c89de696f035
MD5 e6edc3b68c54a407d4b0b7a25981d25b
BLAKE2b-256 6361b5c2211db5c7483302dbc3de7984dd079c242eeb9e8baa1c24838b143773

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page