WENGSYX commited on
Commit
31601e3
1 Parent(s): 462b598

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +35 -3
README.md CHANGED
@@ -1,3 +1,35 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Model card for CoNN Parity
2
+
3
+
4
+ ### Introduction
5
+ In paper Neural Comprehension: Language Models with Compiled Neural Networks , we introduced the integration of Compiled Neural Networks (CoNN) into the framework of language models, enabling existing language models to perform symbolic operations with perfect accuracy without the need for external tools. In this model card, we introduce the Parity model, which is similar to the Transformer model and can be used to perform the Parity task.
6
+
7
+
8
+ ### Install
9
+
10
+ #### Install
11
+
12
+ ```
13
+ git clone https://github.com/WENGSYX/Neural-Comprehension
14
+ cd apex
15
+ pip install .
16
+ ```
17
+
18
+ To run neural comprehension, you need to install `PyTorch`, `Transformers`, `jax`, and `tracr`.
19
+
20
+
21
+
22
+ ### How to Use?
23
+
24
+ ```
25
+ from NeuralComprehension.CoNN.modeling_conn import CoNNModel
26
+ from NeuralComprehension.tracr4torch import Tokenizer
27
+
28
+
29
+ model = CoNNModel.from_pretrained('WENGSYX/CoNN_Parity')
30
+ tokenizer = Tokenizer(model.config.input_encoding_map, model.config.output_encoding_map,model.config.max_position_embeddings)
31
+
32
+ output = model(tokenizer('1 1 0 0 1 0').unsqueeze(0))
33
+ print(tokenizer.decode(output.argmax(2)))
34
+ >>> [['bos', '1', '1', '1', '1', '1', '1']]
35
+ ```