"""Build an honest static report; never present it as online model inference.""" import html import json import shutil import sys import zipfile from pathlib import Path ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(ROOT)) from settings import OUTPUTS from publish_space import source_files def build(): site = ROOT / "_report_site" site.mkdir(exist_ok=True) runs = [] for record_file in sorted(OUTPUTS.glob("*/run.json")) if OUTPUTS.exists() else []: record = json.loads(record_file.read_text(encoding="utf-8")) run_id = record_file.parent.name target = site / "results" / run_id target.mkdir(parents=True, exist_ok=True) links = [] for file in record_file.parent.iterdir(): if file.is_file() and file.suffix in (".json", ".txt", ".png", ".wav", ".mp4"): shutil.copyfile(file, target / file.name) links.append((file.name, f"results/{run_id}/{file.name}")) runs.append((record, links)) cards = [] for record, links in runs: media = [] for name, url in links: escaped = html.escape(url, quote=True) if name.endswith(".png"): media.append(f'模型实际生成图片') elif name.endswith(".mp4"): media.append(f'') elif name.endswith(".wav"): media.append(f'') media.append(f'

{html.escape(name)}

') cards.append('

实际执行记录

状态:'+html.escape(record['status'])+ '

提示词:'+html.escape(record.get('prompt',''))+ '

'+html.escape(record.get('text',record.get('error','')))+
                     '

耗时:'+str(record.get('elapsed_seconds','未测量'))+' 秒;峰值显存:'+ str(record.get('peak_gpu_gib','未测量'))+' GiB

'+''.join(media)+'
') files = source_files() with zipfile.ZipFile(site/'nextgpt-source-and-results.zip', 'w', compression=zipfile.ZIP_DEFLATED) as archive: for file in files: archive.write(file, 'nextgpt-reproduction/'+file.relative_to(ROOT).as_posix()) for _, links in runs: for _, relative in links: archive.write(site/relative, 'nextgpt-reproduction/submission_results/'+relative) code = site/'code' for file in files: destination = code/file.relative_to(ROOT) destination.parent.mkdir(parents=True, exist_ok=True) shutil.copyfile(file, destination) content = ''' NExT-GPT 课程复现报告

NExT-GPT 多模态课程复现

本页为静态报告、源码和实际执行结果展示,不提供在线模型推理。按用户提供的老师补充说明,无法部署 GPU Space 时可提交代码与执行结果文件。

项目与下载

官方 NExT-GPT 7b_tiva_v0,Vicuna v0 基座;本地采用 CPU 参数卸载以适配 8GB GPU,没有用其他模型替代。

下载源码及执行结果 · 运行说明 · 复现报告 · 验证记录

权重来源:LLaMA 7B、Vicuna v0 delta、NExT-GPT delta。

''' content += ''.join(cards) if cards else '

模型推理状态

尚无完整模型执行记录。CPU 基础检查不能替代模型推理结果。

' content += '

执行成功仅表示程序完成;生成内容质量与模态完整性需结合原始记录检查。

' (site/'index.html').write_text(content, encoding='utf-8') (site/'README.md').write_text('---\ntitle: NExT-GPT Course Report\nemoji: 📘\ncolorFrom: blue\ncolorTo: indigo\nsdk: static\napp_file: index.html\n---\n\nStatic reproduction report and actual execution results. No online model inference.\n', encoding='utf-8') (site/'provenance.json').write_text(json.dumps({'project':'nextgpt-chapter6-static-report'})) print(json.dumps({'site':str(site),'recorded_model_runs':len(runs)})) return site if __name__ == '__main__': build()