Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,30 +1,3 @@
|
|
1 |
-
import os
|
2 |
import gradio as gr
|
3 |
-
import torch
|
4 |
-
import numpy as np
|
5 |
-
from transformers import pipeline
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-large", model_kwargs={"device_map": "auto"})
|
10 |
-
|
11 |
-
examples = []
|
12 |
-
|
13 |
-
title = "Flan T5 and Vanilla T5"
|
14 |
-
description = ""
|
15 |
-
|
16 |
-
def inference(text):
|
17 |
-
output_flan = pipe_flan(text, max_length=100)[0]["generated_text"]
|
18 |
-
return [output_flan]
|
19 |
-
|
20 |
-
io = gr.Interface(
|
21 |
-
inference,
|
22 |
-
gr.Textbox(lines=3),
|
23 |
-
outputs=[
|
24 |
-
gr.Textbox(lines=3, label="Flan T5"),
|
25 |
-
],
|
26 |
-
title=title,
|
27 |
-
description=description,
|
28 |
-
examples=examples
|
29 |
-
)
|
30 |
-
io.launch()
|
|
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
2 |
|
3 |
+
gr.Interface.load("models/google/flan-t5-xl").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|