Spaces:
Runtime error
Runtime error
Update
Browse files
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 =
|
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 |
|