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.13.tar.gz (343.7 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.13-py3-none-any.whl (428.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shangshanai-0.1.13.tar.gz
  • Upload date:
  • Size: 343.7 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.13.tar.gz
Algorithm Hash digest
SHA256 e0021c86b7403b8f144ab80aac598a3c7bdd2e9274fb75c1d9f84c1ff2fd64ee
MD5 348069f75d53bbeea3b542968aa0bda6
BLAKE2b-256 2282ab3c67501373310ce4e3a0d7f39f8b08fcf2de87cd5fb4bd04a9bcddbaa3

See more details on using hashes here.

File details

Details for the file shangshanAI-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: shangshanAI-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 428.0 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 5ef91adc5d62c5bac2e1cddaee6751b6bd02da6903fa5923aa77834512b2dea6
MD5 8769fa2a78d6ff892163a98c2cff1b8a
BLAKE2b-256 1e59e73a7b63062462c264fba1fed02acc9e3c844dbe335258961727db3e3cbc

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