File size: 1,069 Bytes
9ef0b41 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import urllib.request, json, os, sys
def fetch_raw(owner, repo, path):
url = f'https://raw.githubusercontent.com/{owner}/{repo}/main/{path}'
try:
with urllib.request.urlopen(url) as resp:
return resp.read().decode('utf-8')
except Exception as e:
return f'ERROR: {e}'
files = [
('ticketguy', 'littlefig', 'benchmark/benchmark_gpu.py'),
('ticketguy', 'littlefig', 'cogmembench/runner.py'),
('ticketguy', 'littlefig', 'cogmembench/scorer.py'),
('ticketguy', 'littlefig', 'src/little_fig/engine/memory_fabric.py'),
('ticketguy', 'littlefig', 'src/little_fig/engine/model.py'),
('ticketguy', 'littlefig', 'pyproject.toml'),
('ticketguy', 'Lila', 'src/main.py'),
('ticketguy', 'Lila', 'README.md'),
('ticketguy', 'embers-diaries', 'pyproject.toml'),
]
for owner, repo, path in files:
content = fetch_raw(owner, repo, path)
out_path = f'/tmp/{repo}_{path.replace("/", "_")}'
with open(out_path, 'w') as f:
f.write(content)
print(f'Wrote {out_path} ({len(content)} chars)')
|