tone3000 metadata capture: save .meta.json alongside downloaded models
- UI now sends full Tone3000 metadata on install (id, author, architecture, pack_name, description, thumbnail, etc.) - Search results show size, architecture, and pack name - Install endpoint saves a .meta.json file next to each .nam with: author, architecture, description, pack, thumbnail, download date - Enables offline browsing of model provenance
This commit is contained in:
@@ -1950,6 +1950,25 @@ class WebServer:
|
||||
path = await client.download_model(model)
|
||||
if not path:
|
||||
raise HTTPException(status_code=500, detail="Download failed")
|
||||
# Save metadata alongside the model file
|
||||
import json
|
||||
meta = {
|
||||
"id": data.get("id"),
|
||||
"name": data.get("name"),
|
||||
"filename": data.get("filename"),
|
||||
"size_bytes": data.get("size"),
|
||||
"author": data.get("author"),
|
||||
"author_avatar": data.get("author_avatar"),
|
||||
"thumbnail": data.get("thumbnail"),
|
||||
"tone_description": data.get("tone_description"),
|
||||
"pack_name": data.get("pack_name"),
|
||||
"architecture": data.get("architecture"),
|
||||
"created_at": data.get("created_at"),
|
||||
"download_date": datetime.datetime.now().isoformat(),
|
||||
"source": "tone3000",
|
||||
}
|
||||
meta_path = path.with_suffix(".meta.json")
|
||||
meta_path.write_text(json.dumps(meta, indent=2))
|
||||
# Refresh the model list via NAM host
|
||||
nam = self.deps.nam_host
|
||||
if nam:
|
||||
|
||||
Reference in New Issue
Block a user