-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.cs
51 lines (49 loc) · 1.82 KB
/
Config.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace ML.NET_test
{
public class Config
{
public static Config FromFile(string path)
{
using (var stream = File.OpenRead(path))
{
using (var textReader = new StreamReader(stream))
{
using (var jsonReader = new JsonTextReader(textReader))
{
return JsonSerializer.CreateDefault()
.Deserialize<Config>(jsonReader);
}
}
}
}
public string _name_or_path { get; set; }
public string activation { get; set; }
public string[] architectures { get; set; }
public float attention_dropout { get; set; }
public int dim { get; set; }
public float dropout { get; set; }
public string finetuning_task { get; set; }
public int hidden_dim { get; set; }
public Dictionary<string, string> id2label { get; set; }
public float initializer_range { get; set; }
public Dictionary<string, string> label2id { get; set; }
public int max_position_embeddings { get; set; }
public string model_type { get; set; }
public int n_heads { get; set; }
public int n_layers { get; set; }
public bool output_past { get; set; }
public int pad_token_id { get; set; }
public float qa_dropout { get; set; }
public float seq_classif_dropout { get; set; }
public bool sinusoidal_pos_embds { get; set; }
public bool tie_weights_ { get; set; }
public string transformers_version { get; set; }
public int vocab_size { get; set; }
}
}