Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,18 +14,6 @@ def predict(input_ids):
|
|
14 |
res = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
15 |
return res
|
16 |
|
17 |
-
@app.route('/', methods=['POST', 'GET'])
|
18 |
-
def index():
|
19 |
-
if request.method == 'POST':
|
20 |
-
inp = request.form['content']
|
21 |
-
inp_ids = preprocess(inp)
|
22 |
-
summary = predict(inp_ids)
|
23 |
-
return render_template('index.html', summary=summary)
|
24 |
-
else:
|
25 |
-
print("GETTING get")
|
26 |
-
return render_template('index.html', summary="Nothing to summarize")
|
27 |
-
|
28 |
-
|
29 |
if __name__ == '__main__':
|
30 |
st.title("Text summary with fine-tuned Pegasus model")
|
31 |
with st.container():
|
|
|
14 |
res = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
15 |
return res
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
if __name__ == '__main__':
|
18 |
st.title("Text summary with fine-tuned Pegasus model")
|
19 |
with st.container():
|