Spaces:
Build error
Build error
Create config.py
Browse files
config.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
config = {
|
| 2 |
+
# tokenizer
|
| 3 |
+
'tokenizer_path_retrieval': 'imamnurby/bow-tokenizer-uncased',
|
| 4 |
+
|
| 5 |
+
# model_path
|
| 6 |
+
'model_path_retrieval': 'library_retriever/retrieval_distillbert',
|
| 7 |
+
'model_path_generative': 'pattern_generator/generative_codebert2codebert',
|
| 8 |
+
'model_path_classifier': 'config_classifier/classifier_codebert_11nov_latest',
|
| 9 |
+
'classifier_head_path': 'config_classifier/classifier_head_rf_11nov.pkl',
|
| 10 |
+
|
| 11 |
+
# db path
|
| 12 |
+
'db_metadata_path': '.assets/lib_to_features.csv',
|
| 13 |
+
'db_constructor_path': 'assets/lib_to_constructor.csv',
|
| 14 |
+
|
| 15 |
+
# retrieval_model_setting
|
| 16 |
+
'max_k': 10,
|
| 17 |
+
|
| 18 |
+
# generative_model_setting
|
| 19 |
+
'num_beams': 5,
|
| 20 |
+
'num_return_sequences': 3,
|
| 21 |
+
|
| 22 |
+
# hw_classifier setting
|
| 23 |
+
'max_length': 512
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
classifier_class_mapping = {
|
| 27 |
+
0: {'protocol': 'UART',
|
| 28 |
+
'pin_connection_from_hw_to_arduino': {
|
| 29 |
+
'arduino_mega': [('RX-->19, TX-->18')],
|
| 30 |
+
'arduino_uno': [('RX-->0, TX-->1')]
|
| 31 |
+
}
|
| 32 |
+
},
|
| 33 |
+
1: {'protocol': 'SPI',
|
| 34 |
+
'pin_connection_from_hw_to_arduino': {
|
| 35 |
+
'arduino_mega': [('SCK-->52, MOSI-->51, MISO-->50, CS-->53')],
|
| 36 |
+
'arduino_uno': [('SCK-->13, MOSI-->11, MISO-->12, CS-->10')]
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
2: {'protocol': 'I2C',
|
| 40 |
+
'pin_connection_from_hw_to_arduino': {
|
| 41 |
+
'arduino_mega': [('SDA-->20, SCL-->21')],
|
| 42 |
+
'arduino_uno': [('SDA-->A4, SCL-->A5')],
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
3: {'protocol': 'Explicit declaration',
|
| 46 |
+
'pin_connection_from_hw_to_arduino': {
|
| 47 |
+
'arduino_mega': [('DATA-->any digital or analog pins')],
|
| 48 |
+
'arduino_uno': [('DATA-->any digital or analog pins')],
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|