merve HF staff commited on
Commit
372f9c1
β€’
1 Parent(s): f53e17c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,9 +1,11 @@
1
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
  import gradio as gr
 
3
 
4
  tokenizer = AutoTokenizer.from_pretrained("merve/chatgpt-prompts-bart-long")
5
  model = AutoModelForSeq2SeqLM.from_pretrained("merve/chatgpt-prompts-bart-long", from_tf=True)
6
 
 
7
  def generate(prompt):
8
 
9
  batch = tokenizer(prompt, return_tensors="pt")
 
1
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
  import gradio as gr
3
+ import spaces
4
 
5
  tokenizer = AutoTokenizer.from_pretrained("merve/chatgpt-prompts-bart-long")
6
  model = AutoModelForSeq2SeqLM.from_pretrained("merve/chatgpt-prompts-bart-long", from_tf=True)
7
 
8
+ @spaces.GPU
9
  def generate(prompt):
10
 
11
  batch = tokenizer(prompt, return_tensors="pt")