一个用于从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.16.tar.gz
(343.8 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.16-py3-none-any.whl
(428.1 kB
view details)
File details
Details for the file shangshanai-0.1.16.tar.gz.
File metadata
- Download URL: shangshanai-0.1.16.tar.gz
- Upload date:
- Size: 343.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
427378daba448c74a7d626c01656601cfd49ae8685965f07ea004a601f63c2eb
|
|
| MD5 |
7d31da22bb9daa2c298fca4f88b2ef6d
|
|
| BLAKE2b-256 |
945baff2314fcce2b6e5f04fd7cbcba15bd968e5b65b761fcbc645da84de6445
|
File details
Details for the file shangshanAI-0.1.16-py3-none-any.whl.
File metadata
- Download URL: shangshanAI-0.1.16-py3-none-any.whl
- Upload date:
- Size: 428.1 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 |
217b350ba90cdc483a0531bb13d336a5a955b2661005c8ac639e5b3a68f4690b
|
|
| MD5 |
e1e63a707c35a6392004de7abb58ae50
|
|
| BLAKE2b-256 |
d61c03af855f6c3187e6915215e7acb5ad60def197bcfeff99995ff4738f9f48
|