Spaces:
Build error
Build error
Commit
·
7193ee4
1
Parent(s):
37cdd8d
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import torch
|
| 3 |
|
| 4 |
-
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 5 |
|
| 6 |
-
tokenizer = AutoTokenizer.from_pretrained("Einmalumdiewelt/T5-Base_GNAD")
|
| 7 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("Einmalumdiewelt/T5-Base_GNAD")
|
| 8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 9 |
model.to(device)
|
| 10 |
|
|
@@ -27,9 +27,12 @@ examples = [["summarize: Maschinelles Lernen ist ein Oberbegriff für die „kü
|
|
| 27 |
# description=description,
|
| 28 |
# examples=examples)
|
| 29 |
|
| 30 |
-
interface = gr.Interface.load(
|
| 31 |
title=title,
|
| 32 |
description=description,
|
| 33 |
examples=examples)
|
| 34 |
|
| 35 |
-
interface.launch(share=True)
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
#import torch
|
| 3 |
|
| 4 |
+
#from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 5 |
|
| 6 |
+
#tokenizer = AutoTokenizer.from_pretrained("Einmalumdiewelt/T5-Base_GNAD")
|
| 7 |
+
#model = AutoModelForSeq2SeqLM.from_pretrained("Einmalumdiewelt/T5-Base_GNAD")
|
| 8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 9 |
model.to(device)
|
| 10 |
|
|
|
|
| 27 |
# description=description,
|
| 28 |
# examples=examples)
|
| 29 |
|
| 30 |
+
interface = gr.Interface.load(summarize
|
| 31 |
title=title,
|
| 32 |
description=description,
|
| 33 |
examples=examples)
|
| 34 |
|
| 35 |
+
interface.launch(share=True)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
|