File tree 1 file changed +14
-13
lines changed
1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change 1
1
(ns scicloj.ml.simpletransformers
2
2
(:require [libpython-clj2.python :refer [py.- py.] :as py]))
3
3
4
+ ; ; Using the "(require ..)" macro makes it crash
4
5
5
6
6
7
18
19
19
20
20
21
(println " train..." )
21
- (py/with-gil-stack-rc-context
22
+ (py/with-gil-stack-rc-context ; ; without this it crashes
22
23
23
- (py/from-import simpletransformers.classification ClassificationModel)
24
+ ; ; having this outside of 'with-gil-stack-rc-context' makes it crash
25
+ (py/from-import simpletransformers.classification ClassificationModel)
24
26
25
27
26
-
27
- (let [
28
- pd (py/import-module " pandas" )
29
- train-df (py. pd DataFrame train-data)
30
- eval-df (py. pd DataFrame eval-data)
28
+ (let [
29
+ pd (py/import-module " pandas" )
30
+ train-df (py. pd DataFrame train-data)
31
+ eval-df (py. pd DataFrame eval-data)
31
32
32
- model (ClassificationModel " bert" " prajjwal1/bert-tiny" :use_cuda false :args
33
- {:num_train_epochs 1
34
- :use_multiprocessing false
35
- :overwrite_output_dir true })
33
+ model (ClassificationModel " bert" " prajjwal1/bert-tiny" :use_cuda false :args
34
+ {:num_train_epochs 1
35
+ :use_multiprocessing false
36
+ :overwrite_output_dir true })
36
37
37
38
38
- x (py. model train_model train-df)]
39
- (println x)))
39
+ x (py. model train_model train-df)]
40
+ (println x)))
40
41
41
42
(println " finished train" )
You can’t perform that action at this time.
0 commit comments