Spaces:
Runtime error
Runtime error
Commit
·
961346c
1
Parent(s):
8ddfa6e
Delete ipynb
Browse files
app.py
CHANGED
@@ -22,8 +22,8 @@ def load_model_tokenizer():
|
|
22 |
|
23 |
|
24 |
@st.cache
|
25 |
-
def load_pipeline(
|
26 |
-
return pipeline("question-answering", model=
|
27 |
|
28 |
|
29 |
# Page config
|
@@ -39,17 +39,12 @@ if uploaded_file is not None:
|
|
39 |
st.write(df.head())
|
40 |
|
41 |
# Load tokenizer and model
|
42 |
-
|
43 |
-
|
|
|
44 |
st.write("Model and tokenizer successfully loaded.")
|
45 |
|
46 |
-
# Pre-process data from csv file
|
47 |
-
|
48 |
-
|
49 |
# Run inference
|
50 |
-
|
51 |
-
|
52 |
-
# Post-process output of model
|
53 |
-
|
54 |
|
55 |
# Present results
|
|
|
22 |
|
23 |
|
24 |
@st.cache
|
25 |
+
def load_pipeline(model_cp, tokenizer_cp):
|
26 |
+
return pipeline("question-answering", model=model_cp, tokenizer=tokenizer_cp)
|
27 |
|
28 |
|
29 |
# Page config
|
|
|
39 |
st.write(df.head())
|
40 |
|
41 |
# Load tokenizer and model
|
42 |
+
model_cp = "aidan-o-brien/recipe-improver"
|
43 |
+
tokenizer_cp = "albert-base-v2"
|
44 |
+
question_answer = load_pipeline(model_cp, tokenizer_cp)
|
45 |
st.write("Model and tokenizer successfully loaded.")
|
46 |
|
|
|
|
|
|
|
47 |
# Run inference
|
48 |
+
first_example = df['review'][0]
|
|
|
|
|
|
|
49 |
|
50 |
# Present results
|