Skip to main content

一个用于从GitLab下载和处理模型的Python SDK

Project description

ShangshanAI SDK

一个用于下载和处理数据的Python SDK。

安装

pip install shangshanAI

下载模型

from shangshanAI import snapshot_download
model_dir = snapshot_download('testuser/model_llm')
print(model_dir)

功能特性

  • 支持文件下载
  • 自动重试机制
  • 进度显示

调用大模型

from shangshanAI import ShangshanAI

client = ShangshanAI(api_key="BkdNcaHp6YUxvYsp6PpzMq", path="/v1/chat/completions")  # 请填写您自己的API Key
response = client.chat.completions.create(
    model="shangshan-chat-beta",  # 填写需要调用的模型编码
    messages=[
        {"role": "user", "content": "你好!你叫什么名字"},
    ],
    stream=True,
)
for chunk in response:
    print(chunk.choices[0].delta.content, end="", flush=True)

许可证

MIT License

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

shangshanai-0.1.19.tar.gz (345.3 kB view details)

Uploaded Source

Built Distribution

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

shangshanai-0.1.19-py3-none-any.whl (429.1 kB view details)

Uploaded Python 3

File details

Details for the file shangshanai-0.1.19.tar.gz.

File metadata

  • Download URL: shangshanai-0.1.19.tar.gz
  • Upload date:
  • Size: 345.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for shangshanai-0.1.19.tar.gz
Algorithm Hash digest
SHA256 da333127ad065dce925f6d2e7da520e20a53ed56ca44e1c4f0d9a015d2801e3f
MD5 af26181678875a03faf25ab603c9a4e6
BLAKE2b-256 ca4e965107c185e96b41cf7b5a493a1e68c59ac2769205bf6b86acb7b6e4dd38

See more details on using hashes here.

File details

Details for the file shangshanai-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: shangshanai-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 429.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for shangshanai-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 71802315c93fa6ab3d93ef3a77b6bf5771702b27beeffcb903da5b64b4ec731b
MD5 f901d499bff7f53ea1a14e159f99102a
BLAKE2b-256 727902f91c4800b25ef0ba1a7521d3f7edb0bb7d2a2fd0197e90c0f9781ea2ba

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