=?unknown-8bit?b?5LiA5LiqQUnlt6XlhbfljIXvvIzluK7liqnnlKjmiLflv6vpgJ/osIPnlKjlsI/mgJ3moYbmnrbvvIhYaWFvdGhpbmvvvInnm7jlhbPmjqXlj6PjgII=?=
Project description
Xiaothink Python ������������������
Xiaothink ���������������������������������NLP���������������AI������������������������������������������������������������������������������������Xiaothink Python ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������
- ������
- ������������������
- ������������������������������������
- ��������������������������� (img_zip)
- ������������������
- ������������
������
������������������������ pip ������ Xiaothink ���������
pip install xiaothink
���������������������������������2025���7���17������������������������������������WebAI���������������������AI���������������������������������������������������������������
License
This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
The NOTICE file contains additional attribution information for the proprietary technologies included in this module.
���������������������������
������������������������������������������������������������������������������������������������������������
������������������������������������������������
������������������������������
������������
import xiaothink.llm.inference.test_formal as tf
model = tf.QianyanModel(
ckpt_dir=r'path/to/your/t6_model',
MT='t6_beta_dense',
vocab=r'path/to/your/vocab'# vocab������������������������������������
)
while True:
inp = input('������������')
if inp == '[CLEAN]':
print('���������������������\n\n')
model.clean_his()
continue
re = model.chat_SingleTurn(inp, temp=0.32) # ������ chat_SingleTurn ������������������
print('\n������������', re, '\n')
������������
������������������������������
������������
import xiaothink.llm.inference.test_formal as tf
model = tf.QianyanModel(
ckpt_dir=r'path/to/your/t6_model',
MT='t6_beta_dense',
vocab=r'path/to/your/vocab'# vocab������������������������������������
)
while True:
inp = input('������������')
if inp == '[CLEAN]':
print('���������������������\n\n')
model.clean_his()
continue
re = model.chat(inp, temp=0.32) # ������ chat ������������������
print('\n������������', re, '\n')
������������
���������������������������������������
������������
import xiaothink.llm.inference.test as test
MT = 't6_beta_dense'
m, d = test.load(
ckpt_dir=r'path/to/your/t6_model',
MT='t6_beta_dense',
vocab=r'path/to/your/vocab'# vocab������������������������������������
)
inp='���������'
belle_chat = '{"conversations": [{"role": "user", "content": {inp}}, {"role": "assistant", "content": "'.replace('{inp}', inp) # t6���������������������������������������������instruct������
inp_m = belle_chat
ret = test.generate_texts_loop(m, d, inp_m,
num_generate=100,
every=lambda a: print(a, end='', flush=True),
temperature=0.32,
pass_char=['���']) #������t6���������������<unk>������
������������������������������������������������ model.chat ������������������������������������������������������������������������������ test.generate_texts_loop ���������** ��������������� model.chat_SingleTurn ������������������������������������ **
������������������������������������
���������������
���1.2.0������������������������������������������������������
- ���������������������(img_zip)������������������������token������������������������������
- ������������������������������������������������������������������������������������������������������������
������������������������
- ������������������������������������������������������������
- ������img_zip������������������������������������������
- ������������������������������
������������������������
���������������������������������������������������������������������������������������
from xiaothink.llm.inference.test_formal import QianyanModel
if __name__ == '__main__':
model = QianyanModel(
ckpt_dir=r'path/to/your/vision_model',
MT='t6_standard_vision', # ���������������������������������
vocab=r'path/to/your/vocab.txt',
imgzip_model_path='path/to/img_zip/model.keras' # ������img_zip������������
)
temp = 0.28 # ������������
while True:
inp = input('������������')
if inp == '[CLEAN]':
print('���������������������\n\n')
model.clean_his()
continue
# ������chat_vision������������
ret = model.chat_vision(inp, temp=temp, pre_text='', pass_start_char=[])
print('\n������������', ret, '\n')
���������������
- ������������������������
chat_vision���������������������chat��������������������������������� - ���������������������������������������������img_zip���������������������������
- ���������������������������������������������������������token������
������������������
���������������������������������
-
img2ms���������������������������������������
description = model.img2ms('path/to/image.jpg', temp=0.28) print(description)
-
img2ms_vision������������������������������������
description = model.img2ms_vision('path/to/image.jpg', temp=0.28, max_shape=224) print(description)
������������������
������������������������������������������������
<img>���������������URL</img>������������������������
������������������������������������������������������������������������������������������
���������������
- ������������������������������������������������������
- ������������������������������������������������������
- img_zip���������������������������������������������
��������������������������� (img_zip)
img_zip ���������������������������������������������/������������������������������������������������������������������������������������������
1. ���������������������
python -m xiaothink.llm.img_zip.img_zip
���������������������������������������������
===== img_zip ������������������������ =====
���������.keras������������: path/to/your/imgzip_model.keras
������������������!
���������������:
1. ������������
2. ������������
3. ������������
4. ������������
0. ������
��������� (0-6):
2. Python ������������
from xiaothink.llm.img_zip.img_zip import ImgZip
# ���������������
img_zip = ImgZip(model_path='path/to/your/imgzip_model.keras')
# ������������
compressed_path = img_zip.compress_image(
img_path='input.jpg',
patch=True, # ������������������������
save_path='compressed_img' # ������������������
ability=0.02,# 1.2.5���������������������������������������0.02������ability���0������������������������������������������������������������������������������������������������������������������������������
)
# ������������������: compressed_img.npy ��� compressed_img.shape
# ������������
img_zip.decompress_image(
compressed_input='compressed_img', # ������������������
patch=True, # ������������������������
save_path='decompressed.jpg' # ������������
)
# ������������
compressed_paths, metadata_path = img_zip.compress_video(
video_path='input.mp4',
output_dir='compressed_video', # ������������
patch=True # ������������������������
)
# ������������
img_zip.decompress_video(
compressed_dir='compressed_video', # ������������������
output_path='decompressed.mp4' # ������������
)
# ������������������������
img_array = img_zip.image_to_array('input.jpg')
img_zip.save_image_array(img_array, 'image_array.npy')
# ���������������������
loaded_array = img_zip.load_image_array('image_array.npy')
img = img_zip.array_to_image(loaded_array)
img.save('restored.jpg')
3. ������������������
-
������������ (
compress_image)patch=True: ������������������80x80���������������- ������������������:
.npy(������������) ���.shape(������������������)
-
������������ (
decompress_image)- ������
.npy���.shape������������ - ������������������������
- ������
-
������������ (
compress_video/decompress_video)- ������������������������������������
- ���������������������������������������������
- ������������������������������������
4. ������������
| ������ | ������ | ������ |
|---|---|---|
model_path |
str | img_zip������������ (.keras������) |
patch |
bool | ������������������������ (���������True) |
save_path |
str | ������������������������ |
img_path |
str | ������������������ |
video_path |
str | ������������������ |
output_dir |
str | ������������������ |
output_path |
str | ������������������ |
5. ������������������
-
������������:
- ���������������������80x80���
- ���������������������������������
- ������������������������
-
������������:
- ������������������������������
- ������������������������ (fps, ���������)
- ������������������������������������
-
������������:
- ���������������������������������
- ���������������������������������������
-
������������:
- ���������������������������
- ���������������������������
6. ������������
- ������������80x80������������������������������������ (
patch=True) - ���������������������������������������������������������
- ���������������������������������������
- ������������������������������������������
������������Xiaothink������������������������������������������������������������������������������������������������������������������������������������������������AI���������������������������������������
������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������
- ���������������������������������Xiaothink T6������������������������������������
- ���������������������������������������������������������������������������������
- ���������������������������������������������������
- ������������������������������������������������Xiaothink-T6-0.15B-ST
������������
from xiaothink.llm.inference.test_formal import *
from xiaothink.llm.tools.classify import *
if __name__ == '__main__':
# ���������������������������
model = QianyanModel(
ckpt_dir=r'path/to/your/t6_model', # ������������������ ������������_ST���������
MT='t6_standard', # ������������������������������������
vocab=r'path/to/your/vocab.txt', # ���������������
use_patch=0 # ������������������������������������������
)
# ���������������������������������������������������������
cmodel = ClassifyModel(model)
# ������������������������������������
while True:
inp = input('���������������')
res = cmodel.emotion(inp) # ������������������������
print(res) # ������������������������
������������
- ���������������������������������������
QianyanModel������������������������������������ - ���������������������������������������������
t6_standard��������������������������������������������� - ������������������������{'������': 0.6667, '������': 0.1667, '������': 0.1667}
������������������������������������������MT������������������������������form���������prompt������������������������
| ��������������������������������� | mt ������ | form ������ |
|---|---|---|
| Xiaothink-T6-0.08B | mt='t6_beta_dense' | form=1 |
| Xiaothink-T6-0.15B | mt='t6_standard' | form=1 |
| Xiaothink-T6-0.02B | mt='t6_fast' | form=1 |
| Xiaothink-T6-0.5B | mt='t6_large' | form=1 |
| Xiaothink-T6-0.5B-pretrain | mt='t6_large' | form='pretrain' |
������������
������ 1.2.5 (2025-09-02)
- ���������������
- ImgZIP���������������������������������������������������������������������������������������������������������������������������������������������������������������
������ 1.2.4 (2025-08-30)
- ���������������
- ���������������ImgZIP���������������������������������from xiaothink.llm.img_zip.img_zip import ImgZip
������ 1.2.3 (2025-08-30)
- ���������������
- ���������Xiaothink-T6-0.02B���������������MT='t6_fast'���
- ���������Xiaothink-T6-0.5B���������������MT='t6_large'���
- ���model.chat������������������form='pretrain'������������t6������������������������������������form=1���������������������������form='pretrain'
������ 1.2.2 (2025-08-18)
- ���������������
- ���������������������������������
ClassifyModel������������������������������ - ������
xiaothink.llm.tools.classify������������������������������������������������������ - ������
cmodel.emotion(inp)���������������������������������������
- ���������������������������������
������ 1.2.1 (2025-08-16)
- ���������������
- ���������Xiaothink-T6-0.15B���������������MT='t6_standard'���
������ 1.2.0 (2025-08-08)
-
������������������
- ���������������������������������������������������������������������
- ���������������������token(img_zip) + ���������������������������������
- ������������������������������������������������������������������
-
���������������
model.chat_vision���������������������������������model.img2ms������������������������������������������model.img2ms_vision������������������������������������������������max_shape���������
-
���������������
- ������
xiaothink.llm.img_zip.img_zip��������������� - ���������������������������������������
- ���������������������������������������
- ������
-
���������������
- ������������������������
chat_vision������ - ���������������������img_zip���������������
- ���������������������������������
- ������������������������
������ 1.1.0 (2025-08-02)
-
���������������
- ������
img2ms���ms2img������������������������������������������������ - ������������������������AI���������������tokens
- ������������������������������������������������+���������
- test_formal������������������������������AI���������������tokens������������������������������������������������
- ������
-
���������������
- ���������������������������img_zip������
- ������80x80x3������������������������
- ������������96������������������������.7z���������������10%���������������
-
���������������
- ������������������
<img>{image_path}</img>������������������ - ���������������������������img_zip������������
- ���������������������������������������������������������������
- ������������������
������������ Xiaothink Python ���������������������������������������
������������������������������������������������������xiaothink@foxmail.com���
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
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
File details
Details for the file xiaothink-1.2.5.2.tar.gz.
File metadata
- Download URL: xiaothink-1.2.5.2.tar.gz
- Upload date:
- Size: 57.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f0ade00a9099962f9849aeb6c02080f1c359c72512d1cab533b7b85d734a8bb
|
|
| MD5 |
c9d85fcb53597b3a2e4aa9088432000b
|
|
| BLAKE2b-256 |
b55c1e020be8398b5a50c4deca16b50ae3c577a741702fe6703b698274220ed0
|
File details
Details for the file xiaothink-1.2.5.2-py3-none-any.whl.
File metadata
- Download URL: xiaothink-1.2.5.2-py3-none-any.whl
- Upload date:
- Size: 52.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9139d0d0d21d8eaca21db1522a4df4b177e110628c71bf8bcfb5ae537d8616f8
|
|
| MD5 |
643fb5fa28e02fa94bc90bd7c70cfd9e
|
|
| BLAKE2b-256 |
c032ff27b363cf75a158bbdd340501740368ad1bcfcff066a459b8047c9ac4e2
|