Zalohovani vsech podstatnych souboru

This commit is contained in:
lachtan
2026-06-10 06:39:52 +02:00
parent 1e10891945
commit 67e29c8b88
69 changed files with 9115 additions and 0 deletions

23
scripts/parse_library.py Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""Parse the ollama library page text dump and list unique models."""
import re, json, sys
raw = open('scripts/ollama_library_full.txt').read()
first_line = raw.split('\n')[0]
# Each line is prefixed "N| " repeated; find the first { and the last }
start = first_line.find('{')
end = first_line.rfind('}') + 1
first_line = first_line[start:end]
j = json.loads(first_line)
text = j['text']
print('text length:', len(text))
# Pattern: ## [name desc](https://ollama.com/library/normalized)
matches = re.findall(r'## \[([a-z0-9.\-]+) [^\]]*\]\(https://ollama.com/library/([a-z0-9.\-]+)\)', text)
seen = {}
for desc, name in matches:
seen.setdefault(name, desc)
print('Total models in library page:', len(seen))
for n in sorted(seen):
print(f'{n}\t{seen[n][:80]}')