philipp-zettl commited on
Commit
6c8898d
1 Parent(s): de2571c

add zero gpu changes

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  import torch
 
3
  import itertools
4
  import pandas as pd
5
  from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
@@ -47,6 +48,7 @@ def run_model(inputs, tokenizer, model, temperature=0.5, num_return_sequences=1)
47
  return all_outputs
48
 
49
 
 
50
  def gen(content, temperature_qg=0.5, temperature_qa=0.75, num_return_sequences_qg=1, num_return_sequences_qa=1):
51
  inputs = [
52
  f'context: {content}'
 
1
  import gradio as gr
2
  import torch
3
+ import spaces
4
  import itertools
5
  import pandas as pd
6
  from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
 
48
  return all_outputs
49
 
50
 
51
+ @spaces.GPU
52
  def gen(content, temperature_qg=0.5, temperature_qa=0.75, num_return_sequences_qg=1, num_return_sequences_qa=1):
53
  inputs = [
54
  f'context: {content}'