alirani
commited on
Commit
·
ee85c1a
1
Parent(s):
c374e34
fix
Browse files
app.py
CHANGED
@@ -32,7 +32,6 @@ st.title('Demo LoreFinder')
|
|
32 |
st.header('Generate a story')
|
33 |
|
34 |
prod_title = st.text_input('Type a title to generate a synopsis')
|
35 |
-
prod_synopsis = st.text_input('Type a synopsis to guess the genre')
|
36 |
|
37 |
option_genres = st.selectbox(
|
38 |
'Select a genre to tailor your synopsis',
|
@@ -43,19 +42,9 @@ option_genres = st.selectbox(
|
|
43 |
|
44 |
button_synopsis = st.button('Get synopsis')
|
45 |
|
46 |
-
button_genres = st.button('Get genres')
|
47 |
-
|
48 |
if button_synopsis:
|
49 |
if len(prod_title.split(' ')) > 0:
|
50 |
gen_synopsis = generate_synopsis(model_gen, tokenizer_gen, f"{prod_title} | {option_genres} | ")
|
51 |
st.text_area('Generated synopsis', value=gen_synopsis, disabled=True)
|
52 |
else:
|
53 |
-
st.write('Write a title for the generator to work !')
|
54 |
-
|
55 |
-
if button_genres:
|
56 |
-
if len(prod_title.split(' ')) > 0:
|
57 |
-
classifier_output = generate_classification(model_clf, tokenizer_clf, prod_title, prod_synopsis)
|
58 |
-
print(classifier_output)
|
59 |
-
st.write(f"Guessed genre : {classifier_output}")
|
60 |
-
else:
|
61 |
-
st.write('Write a title and a synopsis for the classifier to work !')
|
|
|
32 |
st.header('Generate a story')
|
33 |
|
34 |
prod_title = st.text_input('Type a title to generate a synopsis')
|
|
|
35 |
|
36 |
option_genres = st.selectbox(
|
37 |
'Select a genre to tailor your synopsis',
|
|
|
42 |
|
43 |
button_synopsis = st.button('Get synopsis')
|
44 |
|
|
|
|
|
45 |
if button_synopsis:
|
46 |
if len(prod_title.split(' ')) > 0:
|
47 |
gen_synopsis = generate_synopsis(model_gen, tokenizer_gen, f"{prod_title} | {option_genres} | ")
|
48 |
st.text_area('Generated synopsis', value=gen_synopsis, disabled=True)
|
49 |
else:
|
50 |
+
st.write('Write a title for the generator to work !')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|