Vageesh1 commited on
Commit
e892945
·
1 Parent(s): d5ca93c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -127,9 +127,20 @@ def ui():
127
  # Add a submit button
128
  if st.button("Submit"):
129
  # Generate a chatbot response
 
130
  bio = conversational_chat(prompt, name_input)
 
131
  # Count words in the generated bio
132
  bio_word_count = word_count(bio)
 
 
 
 
 
 
 
 
 
133
  st.write(f"Generated Bio Word Count: {bio_word_count}")
134
  st.write(bio)
135
 
 
127
  # Add a submit button
128
  if st.button("Submit"):
129
  # Generate a chatbot response
130
+ name_input = st.text_input("Enter your name:")
131
  bio = conversational_chat(prompt, name_input)
132
+
133
  # Count words in the generated bio
134
  bio_word_count = word_count(bio)
135
+
136
+ # Check if the bio exceeds 250 words
137
+ if bio_word_count > 250:
138
+ st.warning("Generated Bio exceeded 250 words. Re-inferencing...")
139
+ bio = conversational_chat(prompt, name_input) # Re-inferencing
140
+
141
+ # Count words in the re-inferenced bio
142
+ bio_word_count = word_count(bio)
143
+
144
  st.write(f"Generated Bio Word Count: {bio_word_count}")
145
  st.write(bio)
146