Spaces:
Build error
Build error
Download app.py from igorithm/PaperClassification: direct link, hf CLI and curl.
- Browser
- Download file 535 Bytes
-
https://huggingface.co/spaces/igorithm/PaperClassification/resolve/main/app.py
- Command line
-
hf download hf://spaces/igorithm/PaperClassification/app.py
-
curl -L -o app.py https://huggingface.co/spaces/igorithm/PaperClassification/resolve/main/app.py
535 Bytes
| import streamlit as st | |
| from category_classification.models import models as class_models | |
| from common import Input | |
| def load_class_model(name): | |
| model = class_models.get_model(name) | |
| return model | |
| model_name = st.selectbox( | |
| "Select model", | |
| options=class_models.get_all_model_names() | |
| ) | |
| title = st.text_area("Paper title") | |
| abstract = st.text_area("Paper abstract") | |
| if title: | |
| input = Input(title=title, abstract=abstract) | |
| model = load_class_model(model_name) | |
| out = model(input) | |
| st.json(out) | |