Diffusers
Safetensors

Run this model with HF Jobs

Run xfcghj/AR on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/xfcghj/AR. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/xfcghj/AR on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
AR / check_text.py
xfcghj's picture
Upload folder using huggingface_hub
f0fc238 verified
Raw History Blame Contribute Delete
2.46 kB
import io
import tarfile
import pickle
import zstandard
# 只拿第一个包来做实验
archive_path = "/home/dataset-assist-0/usr/lh/ysh/dw/RL/AR/data/DyMesh_50000v_16f_0001_part_00"
print("正在抽取前 3 个文件窥探内部完整的文本和数据结构...\n")
with open(archive_path, 'rb') as fh:
dctx = zstandard.ZstdDecompressor()
with dctx.stream_reader(fh) as reader:
with tarfile.open(fileobj=reader, mode='r|') as tar:
count = 0
for member in tar:
if member.isfile():
count += 1
print(f"=== [文件 {count}] {member.name} ===")
f = tar.extractfile(member)
if f is not None:
mem_file = io.BytesIO(f.read())
data = pickle.load(mem_file)
if isinstance(data, dict):
# 1. 打印里面所有的键
print(f" 📦 字典包含的所有 Key: {list(data.keys())}")
# 2. 自动寻找并打印文本内容
text_keys = ['caption', 'text', 'prompt', 'description']
found_text = False
for tk in text_keys:
if tk in data:
print(f" 📝 文本标注 ({tk}): \"{data[tk]}\"")
found_text = True
break
if not found_text:
# 如果不在常用词里,打印出所有不是数组的纯文本/字符串字段
for k, v in data.items():
if isinstance(v, str):
print(f" 📝 发现文本字段 ({k}): \"{v}\"")
# 3. 顺便打印一下矩阵的大小
if 'vertices' in data:
print(f" 📐 顶点矩阵 Shape: {data['vertices'].shape}")
else:
print(" ❌ 该文件不是字典格式")
print("-" * 60 + "\n")
if count >= 100: # 只看前 3 个就退出
break