harpomaxx commited on
Commit
b260a83
·
1 Parent(s): 49bb180

use hugginface model

Browse files
Files changed (1) hide show
  1. app/dga-classifier-service.R +8 -1
app/dga-classifier-service.R CHANGED
@@ -1,9 +1,16 @@
1
  library(keras)
2
  library(plumber)
 
3
 
4
  # loading the DGA model for classifier
5
  #model<-load_model_hdf5("/home/harpo/Dropbox/ongoing-work/git-repos/dga-wb-r/docker/app/pmodel.h5")
6
- model<-load_model_hdf5("/app/asai-2019_model.h5")
 
 
 
 
 
 
7
  modelid="cacic-2018-model"
8
 
9
  valid_characters <- "$abcdefghijklmnopqrstuvwxyz0123456789-_."
 
1
  library(keras)
2
  library(plumber)
3
+ library(reticulate)
4
 
5
  # loading the DGA model for classifier
6
  #model<-load_model_hdf5("/home/harpo/Dropbox/ongoing-work/git-repos/dga-wb-r/docker/app/pmodel.h5")
7
+ #model<-load_model_hdf5("/app/asai-2019_model.h5")
8
+
9
+ hfhub = reticulate::import('huggingface_hub')
10
+ tf <- reticulate::import("tensorflow")
11
+ model <- hfhub$from_pretrained_keras("harpomaxx/dga-detector")
12
+
13
+
14
  modelid="cacic-2018-model"
15
 
16
  valid_characters <- "$abcdefghijklmnopqrstuvwxyz0123456789-_."