philipp-zettl commited on
Commit
e49dc2b
·
verified ·
1 Parent(s): aa43f32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  from model import DecoderTransformer
3
  from huggingface_hub import hf_hub_download
4
  import torch
 
5
 
6
 
7
  vocab_size=33
@@ -19,6 +20,7 @@ model = DecoderTransformer(vocab_size, n_embed, context_size, n_layer, n_head, d
19
  model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))
20
 
21
 
 
22
  def greet(prompt):
23
  return model.generate(prompt)
24
 
 
2
  from model import DecoderTransformer
3
  from huggingface_hub import hf_hub_download
4
  import torch
5
+ import spaces
6
 
7
 
8
  vocab_size=33
 
20
  model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))
21
 
22
 
23
+ @spaces.GPU
24
  def greet(prompt):
25
  return model.generate(prompt)
26