Spaces:
Runtime error
Runtime error
tdnathmlenthusiast
commited on
Commit
•
cde71df
1
Parent(s):
4c91d9b
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,13 @@
|
|
1 |
import transformers
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
-
|
|
|
4 |
from pathlib import Path
|
5 |
from fastai.text.all import *
|
6 |
from datasets import load_dataset
|
7 |
-
from interfaces import interfaces
|
8 |
-
from debinterface.interfaces import interfaces as interfaces2
|
9 |
|
10 |
-
|
11 |
-
adapters2 = interfaces2() # For interfaces from the 'debinterface' package
|
12 |
|
13 |
# Download and prepare SQuAD dataset (not used directly here)
|
14 |
squad = load_dataset("squad")
|
@@ -31,7 +30,7 @@ def generate_summary(input_text):
|
|
31 |
return summary_text
|
32 |
|
33 |
# Create an interface for the model
|
34 |
-
|
35 |
fn=generate_summary, # The function to generate summaries
|
36 |
inputs=gr.inputs.Textbox(), # Input field for text
|
37 |
outputs=gr.outputs.Textbox(), # Output field for generated text
|
|
|
1 |
import transformers
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
+
import gradio as gr
|
4 |
+
from gradio import Interface
|
5 |
from pathlib import Path
|
6 |
from fastai.text.all import *
|
7 |
from datasets import load_dataset
|
8 |
+
from debinterface.interfaces import interfaces
|
|
|
9 |
|
10 |
+
adapters2 = interfaces()
|
|
|
11 |
|
12 |
# Download and prepare SQuAD dataset (not used directly here)
|
13 |
squad = load_dataset("squad")
|
|
|
30 |
return summary_text
|
31 |
|
32 |
# Create an interface for the model
|
33 |
+
interfaces = gr.interfaces(
|
34 |
fn=generate_summary, # The function to generate summaries
|
35 |
inputs=gr.inputs.Textbox(), # Input field for text
|
36 |
outputs=gr.outputs.Textbox(), # Output field for generated text
|