BigSalmon commited on
Commit
7b806a5
·
verified ·
1 Parent(s): c904aac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -17
app.py CHANGED
@@ -225,21 +225,18 @@ with st.sidebar:
225
  )
226
 
227
  # Input text box (now using text_area instead of text_input)
228
- user_input = st.text_area("Enter your input:", height=150)
229
-
230
- if st.button("Generate"):
231
- if user_input:
232
- # Create prompt with history and new input
233
- prompt = history.copy()
234
- prompt.extend([f"input: {user_input}", "output: "])
235
- print(prompt)
236
- # Generate response
237
- try:
238
- response = model.generate_content(prompt)
239
- output = response.text.strip()
240
-
241
  # Display result
242
- st.success(f"Output: {output}")
243
-
244
- except Exception as e:
245
- st.error(f"An error occurred: {str(e)}")
 
225
  )
226
 
227
  # Input text box (now using text_area instead of text_input)
228
+ user_input = st.text_area("Enter your input:", height=150)
229
+ if st.button("Generate"):
230
+ if user_input:
231
+ # Create prompt with history and new input
232
+ prompt = history.copy()
233
+ prompt.extend([f"input: {user_input}", "output: "])
234
+ print(prompt)
235
+ # Generate response
236
+ try:
237
+ response = model.generate_content(prompt)
238
+ output = response.text.strip()
 
 
239
  # Display result
240
+ st.success(f"Output: {output}")
241
+ except Exception as e:
242
+ st.error(f"An error occurred: {str(e)}")