alirani commited on
Commit
ff377ee
β€’
1 Parent(s): 5e605db

feat: add pre-synopsis

Browse files
Files changed (1) hide show
  1. app.py +24 -7
app.py CHANGED
@@ -70,14 +70,31 @@ elif functionality == "Generation":
70
  placeholder="Select genres..."
71
  )
72
 
73
- button_synopsis = st.button('Get synopsis')
74
 
75
- if button_synopsis:
76
- if len(prod_title.split(' ')) > 0:
77
- gen_synopsis = generate_synopsis(model_gen, tokenizer_gen, f"{prod_title} | {option_genres} | ")
78
- st.text_area('Generated synopsis', value=gen_synopsis, disabled=True)
79
- else:
80
- st.write('Write a title for the generator to work !')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  else:
83
  st.write("Select a functionality ! 😊")
 
70
  placeholder="Select genres..."
71
  )
72
 
73
+ complete_synopsis = st.toggle('Synopsis completion')
74
 
75
+ if complete_synopsis:
76
+
77
+ pre_synopsis = st.text_area('Type the beginning of your synopsis')
78
+
79
+ button_synopsis = st.button('Get synopsis')
80
+
81
+ if button_synopsis:
82
+ if (len(prod_title.split(' ')) > 0) & option_genres:
83
+ gen_synopsis = generate_synopsis(model_gen, tokenizer_gen, f"{prod_title} | {option_genres} | {pre_synopsis}")
84
+ st.text_area('Generated synopsis', value=gen_synopsis, disabled=True)
85
+ else:
86
+ st.write('Write a title & select a genre for the generator to work !')
87
+
88
+ else:
89
+
90
+ button_synopsis = st.button('Get synopsis')
91
+
92
+ if button_synopsis:
93
+ if len(prod_title.split(' ')) > 0:
94
+ gen_synopsis = generate_synopsis(model_gen, tokenizer_gen, f"{prod_title} | {option_genres} | ")
95
+ st.text_area('Generated synopsis', value=gen_synopsis, disabled=True)
96
+ else:
97
+ st.write('Write a title for the generator to work !')
98
 
99
  else:
100
  st.write("Select a functionality ! 😊")