Spaces:
Runtime error
Runtime error
Abinaya Mahendiran
commited on
Commit
•
13889d9
1
Parent(s):
086fc23
Updated import
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
"""
|
4 |
|
5 |
# Install necessary libraries
|
6 |
-
from transformers import AutoTokenizer,
|
7 |
import streamlit as st
|
8 |
from pprint import pprint
|
9 |
import json
|
@@ -19,7 +19,7 @@ st.set_page_config(layout="wide")
|
|
19 |
@st.cache(allow_output_mutation=True)
|
20 |
def load_model():
|
21 |
tokenizer = AutoTokenizer.from_pretrained(cfg["model_name_or_path"])
|
22 |
-
model =
|
23 |
generator = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
|
24 |
return generator, tokenizer
|
25 |
|
|
|
3 |
"""
|
4 |
|
5 |
# Install necessary libraries
|
6 |
+
from transformers import AutoTokenizer, GPT2LMHeadModel, pipeline
|
7 |
import streamlit as st
|
8 |
from pprint import pprint
|
9 |
import json
|
|
|
19 |
@st.cache(allow_output_mutation=True)
|
20 |
def load_model():
|
21 |
tokenizer = AutoTokenizer.from_pretrained(cfg["model_name_or_path"])
|
22 |
+
model = GPT2LMHeadModel.from_pretrained(cfg["model_name_or_path"])
|
23 |
generator = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
|
24 |
return generator, tokenizer
|
25 |
|