Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import pandas as pd | |
| import numpy as np | |
| import model | |
| st.title('Movie genre classifier') | |
| st.title('Enter plot') | |
| def load_model(): | |
| return model.load_model_and_tokenizer() | |
| loaded_model, device, tokenizer, MAX_LEN = load_model() | |
| text = st.text_area("Plot") | |
| product = None | |
| label='submit' | |
| if st.button(label): | |
| if text != '': | |
| product = model.predict_genre(text, loaded_model, device, tokenizer, MAX_LEN) | |
| product = ', '.join(product) | |
| if product is not None: | |
| data_load_state = st.text('The genre is') | |
| st.write(product) | |