Views
No views yet
pip install gfn==v2.7.01git lfs install
2git clone https://huggingface.co/DepthMuun/gfn-isn-shakespeare-char
3cd gfn-isn-shakespeare-charinference.py script for interactive generation:python inference.pyinference.py, the official way to load ISN models is:1import torch
2import json
3from gfn import isn
4
5# 1. Load Config
6with open("config.json", "r") as f:
7 config = json.load(f)
8
9# 2. Instantiate Model (Manual Schema)
10model = isn.create(
11 vocab_size=65, # Unique characters in tinyshakespeare.txt
12 d_model=config['model']['d_model'],
13 d_embedding=config['model']['d_embedding'],
14 d_properties=config['model']['d_properties'],
15 scanner_cls=isn.GFNScanner,
16 world_cls=isn.GFNWorld,
17 emitter_cls=isn.GFNEmitter
18).to("cpu")
19
20# 3. Load State Dict
21checkpoint = torch.load("best_model.pt", map_location="cpu")
22model.load_state_dict(checkpoint['model_state_dict'])
23model.eval()
24
25# 4. Generate Text
26# Use model.generate() or the provided inference.py CLI1@article{sturtz2026gfn,
2 title = {Geometric Flow Networks: A Physics-Informed Paradigm for Sequential Intelligence},
3 author = {St{\"u}rtz, Joaqu{\'i}n},
4 journal = {GFN Research Preprint},
5 year = {2026},
6 publisher = {DepthMuun Research},
7 doi = {10.5281/zenodo.19141132},
8 url = {https://doi.org/10.5281/zenodo.19141132}
9}