Enhance trained words extraction and display: include class tokens in response and update UI accordingly. See #147

This commit is contained in:
Will Miao
2025-06-04 12:03:36 +08:00
parent 4b96c650eb
commit b4e7feed06
4 changed files with 167 additions and 46 deletions

View File

@@ -1005,13 +1005,14 @@ class MiscRoutes:
'error': 'File is not a safetensors file'
}, status=400)
# Extract trained words
trained_words = await extract_trained_words(file_path)
# Extract trained words and class_tokens
trained_words, class_tokens = await extract_trained_words(file_path)
# Return result
# Return result with both trained words and class tokens
return web.json_response({
'success': True,
'trained_words': trained_words
'trained_words': trained_words,
'class_tokens': class_tokens
})
except Exception as e: