osanseviero commited on
Commit
6d6196b
1 Parent(s): 83df74d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
3
  import torch
4
  import numpy as np
5
  from transformers import pipeline
 
6
 
7
  import torch
8
  print(f"Is CUDA available: {torch.cuda.is_available()}")
@@ -30,6 +31,7 @@ Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of
30
  title = "Flan T5 and Vanilla T5"
31
  description = "This demo compares [T5-large](https://huggingface.co/t5-large) and [Flan-T5-XX-large](https://huggingface.co/google/flan-t5-xxl). Note that T5 expects a very specific format of the prompts, so the examples below are not necessarily the best prompts to compare."
32
 
 
33
  def inference(text):
34
  output_flan = pipe_flan(text, max_length=100)[0]["generated_text"]
35
  output_vanilla = pipe_vanilla(text, max_length=100)[0]["generated_text"]
 
3
  import torch
4
  import numpy as np
5
  from transformers import pipeline
6
+ import spaces
7
 
8
  import torch
9
  print(f"Is CUDA available: {torch.cuda.is_available()}")
 
31
  title = "Flan T5 and Vanilla T5"
32
  description = "This demo compares [T5-large](https://huggingface.co/t5-large) and [Flan-T5-XX-large](https://huggingface.co/google/flan-t5-xxl). Note that T5 expects a very specific format of the prompts, so the examples below are not necessarily the best prompts to compare."
33
 
34
+ @spaces.GPU
35
  def inference(text):
36
  output_flan = pipe_flan(text, max_length=100)[0]["generated_text"]
37
  output_vanilla = pipe_vanilla(text, max_length=100)[0]["generated_text"]