一个用于从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.12.tar.gz
(343.6 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.12-py3-none-any.whl
(428.0 kB
view details)
File details
Details for the file shangshanai-0.1.12.tar.gz.
File metadata
- Download URL: shangshanai-0.1.12.tar.gz
- Upload date:
- Size: 343.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b243292361ea76f0f8e548d564f97365507409bea81c0285cd68b759e81270a1
|
|
| MD5 |
bdfdef0c74c95c8b28b9625c14813718
|
|
| BLAKE2b-256 |
809371e9b415b8fa523f8c66bcde945be778451449d82726a76f9d7e289fb50f
|
File details
Details for the file shangshanAI-0.1.12-py3-none-any.whl.
File metadata
- Download URL: shangshanAI-0.1.12-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f861b92c8c00b34321b3cddd78657942c477cf648251505df527faf5367187e2
|
|
| MD5 |
63ab4cf38d54e968e7774a5951a55294
|
|
| BLAKE2b-256 |
db1f5a757332d4516b1d2edf1b0f6470ecd30374c4b3c473e08ba119ecd41ddb
|