Spaces:
Runtime error
Runtime error
currentlyexhausted
commited on
Commit
•
60c6dee
1
Parent(s):
ea70358
Replaced Auto with T5 instances
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer,
|
4 |
|
5 |
# Load the model and tokenizer from Hugging Face Spaces
|
6 |
model_name = "currentlyexhausted/flan-t5-summarizer" # update with your model name
|
7 |
-
config =
|
8 |
-
tokenizer =
|
9 |
-
model =
|
10 |
|
11 |
# Define the function to generate summary
|
12 |
def generate_summary(passage):
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
from transformers import T5Tokenizer, T5ForConditionalGeneration, AutoModelForCausalLM, AutoTokenizer, T5Config
|
4 |
|
5 |
# Load the model and tokenizer from Hugging Face Spaces
|
6 |
model_name = "currentlyexhausted/flan-t5-summarizer" # update with your model name
|
7 |
+
config = T5Config.from_pretrained(model_name)
|
8 |
+
tokenizer = T5Tokenizer.from_pretrained(model_name)
|
9 |
+
model = T5ForConditionalGeneration.from_pretrained(model_name, config=config)
|
10 |
|
11 |
# Define the function to generate summary
|
12 |
def generate_summary(passage):
|