Views
No views yet
1
2import os
3from AgGPT10m import AgGPT10m
4
5def main():
6 vocab_file = "vocab.json"
7 agmodel_file = "AgGPT10m.agmodel"
8
9 if not os.path.exists(vocab_file):
10 print(f"Error: Required file '{vocab_file}' not found. Please ensure your vocabulary is built.")
11 return
12
13 if not os.path.exists(agmodel_file):
14 print(f"Error: Required file '{agmodel_file}' not found. Please ensure your encoded model data is generated.")
15 return
16
17 try:
18 ag_gpt_model = AgGPT10m(max_n=2, vocab_path=vocab_file, agmodel_path=agmodel_file)
19 print("AgGPT10m model initialized and trained for N=1 to N=5.")
20
21 prompt = "The"
22 length = 50
23 response = ag_gpt_model.ask(prompt, length)
24 print(f"\nModel response for prompt '{prompt}' (length {length}):\n{response}")
25
26 except Exception as e:
27 print(f"An error occurred: {e}")
28
29if __name__ == "__main__":
30 main()
31
32