zeyadusf commited on
Commit
f93199c
1 Parent(s): ef9d595

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,12 +1,12 @@
1
  import torch
2
  import gradio as gr
3
- from transformers import T5Tokenizer, T5ForConditionalGeneration
4
 
5
  # Load model and tokenizer
6
  def load_model():
7
  model_name = "zeyadusf/text2pandas-T5"
8
- tokenizer = T5Tokenizer.from_pretrained(model_name)
9
- model = T5ForConditionalGeneration.from_pretrained(model_name)
10
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
11
  model = model.to(device)
12
  return model, tokenizer
 
1
  import torch
2
  import gradio as gr
3
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
4
 
5
  # Load model and tokenizer
6
  def load_model():
7
  model_name = "zeyadusf/text2pandas-T5"
8
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
9
+ model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
10
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
11
  model = model.to(device)
12
  return model, tokenizer