-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
81 lines (70 loc) · 2.97 KB
/
Program.cs
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
var HOME = Environment.GetFolderPath (Environment.SpecialFolder.UserProfile);
var command = "llama.cs:llama-3.2-1b-instruct";
Console.WriteLine ($"Running {command}");
switch (command) {
case "llama.cs:stories-260k":
llama.cs.Entrypoint.main (
llama.cs.TokenizerType.llama_cs,
tokenizerModelPath: $"{HOME}/llama/stories-260k/tok512.bin",
paramJsonPath: $"{HOME}/llama/stories-260k/params.json",
modelWeightPath: $"{HOME}/llama/stories-260k/stories260K.pth",
rng_seed: 1,
temperature: 0,
prompt: "Once upon a time");
break;
case "llama.cs:stories-15m":
llama.cs.Entrypoint.main (
llama.cs.TokenizerType.llama_cs,
tokenizerModelPath: "resources/tokenizer.bin",
paramJsonPath: $"{HOME}/llama/stories-15m/params.json",
modelWeightPath: $"{HOME}/llama/stories-15m/stories15M.pth",
rng_seed: 1,
temperature: 0,
prompt: "Once upon a time");
break;
case "llama.cs:stories-15m.bin":
llama.cs.Entrypoint.main (
llama.cs.TokenizerType.llama_cs,
tokenizerModelPath: "resources/tokenizer.bin",
modelWeightPath: "resources/stories15M.bin",
rng_seed: 1,
prompt: "Once upon a time");
break;
case "llama.cs:llama-3.2-1b-instruct":
llama.cs.Entrypoint.main (
llama.cs.TokenizerType.llama_3,
paramJsonPath: $"{HOME}/llama/llama-3.2-1b-instruct/params.json",
modelWeightPath: $"{HOME}/llama/llama-3.2-1b-instruct/consolidated.00.pth",
tokenizerModelPath: $"{HOME}/llama/llama-3.2-1b-instruct/tokenizer.model",
rng_seed: 1,
temperature: 0,
prompt: "The meaning of life is ");
break;
case "llama.cs:llama-3.2-1b-instruct.bin":
llama.cs.Entrypoint.main (
llama.cs.TokenizerType.llama_3,
paramJsonPath: $"{HOME}/llama/llama-3.2-1b-instruct/params.json",
modelWeightPath: $"{HOME}/llama/llama-3.2-1b-instruct/llama-3.2-1b-instruct.bin",
tokenizerModelPath: $"{HOME}/llama/llama-3.2-1b-instruct/tokenizer.model",
rng_seed: 1,
temperature: 0,
prompt: "The meaning of life is ");
break;
case "llama.torchsharp:llama-3.2-1b-instruct":
llama.torchsharp.Entrypoint.run (
HOME + "/llama/llama-3.2-1b-instruct",
"llama.torchsharp/resources",
weightsFile: "consolidated.00.pth",
prompt: "I believe the meaning of life is");
break;
case "llama.torchsharp:stories-15m":
llama.torchsharp.Entrypoint.run (
HOME + "/llama/stories-15m",
"llama.torchsharp/resources", // TODO
weightsFile: "stories15M.pth",
prompt: "Once upon a time");
break;
default:
throw new NotSupportedException (command);
}
Console.WriteLine ("done");