serhii-korobchenko commited on
Commit
c1a178d
1 Parent(s): 95771b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -25,7 +25,12 @@ labels = {
25
 
26
  # Download the NLP model
27
  def download_model_NLP():
28
- pass
 
 
 
 
 
29
 
30
 
31
  #url = "https://drive.google.com/uc?id=1zUGAPg9RVgo7bWtf_-L9MXoXKldZjs1y"
@@ -44,6 +49,9 @@ def download_model():
44
  gdown.download(url, output, quiet=False)
45
  return output
46
 
 
 
 
47
  model_file = download_model()
48
 
49
  # Load the model
 
25
 
26
  # Download the NLP model
27
  def download_model_NLP():
28
+ preprocessor = keras_nlp.models.GPT2CausalLMPreprocessor.from_preset(
29
+ "gpt2_base_en",
30
+ sequence_length=128,)
31
+ model = keras_nlp.models.GPT2CausalLM.from_preset(
32
+ "gpt2_base_en", preprocessor=preprocessor)
33
+ return model
34
 
35
 
36
  #url = "https://drive.google.com/uc?id=1zUGAPg9RVgo7bWtf_-L9MXoXKldZjs1y"
 
49
  gdown.download(url, output, quiet=False)
50
  return output
51
 
52
+
53
+
54
+
55
  model_file = download_model()
56
 
57
  # Load the model