Commit 0a4af05 1 parent 840fe8f commit 0a4af05 Copy full SHA for 0a4af05
File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -77,13 +77,12 @@ def _extract_qa(self, output):
77
77
return qa_list
78
78
79
79
def process (self , sample , rank = None ):
80
- self . model , self . processor = get_model (self .model_key , rank = rank )
80
+ model , processor = get_model (self .model_key , rank = rank )
81
81
82
- inputs = self .processor (sample [self .text_key ],
83
- return_tensors = 'pt' ).to (self .model .device )
84
- response = self .model .generate (** inputs )
85
- output = self .processor .decode (response .cpu ()[0 ],
86
- skip_special_tokens = True )
82
+ inputs = processor (sample [self .text_key ],
83
+ return_tensors = 'pt' ).to (model .device )
84
+ response = model .generate (** inputs )
85
+ output = processor .decode (response .cpu ()[0 ], skip_special_tokens = True )
87
86
qa_list = self ._extract_qa (output )
88
87
89
88
if not len (qa_list ):
You can’t perform that action at this time.
0 commit comments