一个用于从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
Release history Release notifications | RSS feed
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.22.tar.gz
(344.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
shangshanai-0.1.22-py3-none-any.whl
(427.6 kB
view details)
File details
Details for the file shangshanai-0.1.22.tar.gz.
File metadata
- Download URL: shangshanai-0.1.22.tar.gz
- Upload date:
- Size: 344.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38023456a24ea124ac8de9e8adc4bb8250ab09570045cde01f078adf0d9e93eb
|
|
| MD5 |
5d35d61f46edac8d451d398e7c6349c7
|
|
| BLAKE2b-256 |
c1821e5949e8cad476a6525c89195f6b674a16020c4b40916402b9007d189a8f
|
File details
Details for the file shangshanai-0.1.22-py3-none-any.whl.
File metadata
- Download URL: shangshanai-0.1.22-py3-none-any.whl
- Upload date:
- Size: 427.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a60132f3e3d1fd07254418a7e0505492901bd66523e3d1795552a8b3ea1f220
|
|
| MD5 |
9bcdfd9ca4d32b92d7de0e1e359a82f9
|
|
| BLAKE2b-256 |
4f5a013fb78e17cbec13996ddeffd679d0aa5453b4ccdfe38209960e2392fe70
|