currentlyexhausted commited on
Commit
60c6dee
1 Parent(s): ea70358

Replaced Auto with T5 instances

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,12 +1,12 @@
1
  import gradio as gr
2
  import torch
3
- from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig
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 = AutoConfig.from_pretrained(model_name)
8
- tokenizer = AutoTokenizer.from_pretrained(model_name)
9
- model = AutoModelForCausalLM.from_pretrained(model_name, config=config)
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):