erfan226 commited on
Commit
4947e7b
1 Parent(s): f5649ba
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,12 +1,12 @@
1
  import streamlit as st
2
- from transformers import (AutoModel, AutoTokenizer, pipeline)
3
 
4
  # import torch
5
 
6
  st.set_page_config(layout="wide", page_title="تبدیل متون محاوره‌ای به فارسی")
7
 
8
  model_path = 'erfan226/persian-t5-formality-transfer'
9
- model = AutoModel.from_pretrained(model_path)
10
  tokenizer = AutoTokenizer.from_pretrained(model_path)
11
  pipe = pipeline(task='text2text-generation', model=model, tokenizer=tokenizer)
12
 
 
1
  import streamlit as st
2
+ from transformers import (AutoModel, AutoTokenizer, pipeline, T5ForConditionalGeneration)
3
 
4
  # import torch
5
 
6
  st.set_page_config(layout="wide", page_title="تبدیل متون محاوره‌ای به فارسی")
7
 
8
  model_path = 'erfan226/persian-t5-formality-transfer'
9
+ model = T5ForConditionalGeneration.from_pretrained(model_path)
10
  tokenizer = AutoTokenizer.from_pretrained(model_path)
11
  pipe = pipeline(task='text2text-generation', model=model, tokenizer=tokenizer)
12