WENGSYX commited on
Commit
dd48e4a
·
1 Parent(s): 14d866c

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 Sub Carry
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.
6
+ In this model card, we introduce the Add Carry model, which is similar to the Transformer model and can perform borrow operations on a sequence of numbers subtracted.
7
+
8
+
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_Sub_Carry')
30
+ tokenizer = Tokenizer(model.config.input_encoding_map, model.config.output_encoding_map,model.config.max_position_embeddings)
31
+
32
+ output = model(tokenizer('2 -2 3 -9 4 0 8').unsqueeze(0))
33
+
34
+ >>> [['bos', '1', '8', '2', '1', '4', '0', '8']]
35
+ ```