Illia56 commited on
Commit
092c220
·
1 Parent(s): 23a5b76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import streamlit as st
2
  from bardapi import Bard
3
  import os
4
  import requests
@@ -27,12 +27,14 @@ DESCRIPTION = """
27
  def predict(message):
28
  with st.status("Requesting Palm-2🌴..."):
29
  st.write("Requesting API...")
30
- response = bard.get_answer(message)
31
  st.write("Done...")
32
 
33
  st.write("Checking images...")
34
- for i in response['links']:
35
  st.image(i)
 
 
36
  return response['content']
37
 
38
  # Streamlit UI
 
1
+ 'images'import streamlit as st
2
  from bardapi import Bard
3
  import os
4
  import requests
 
27
  def predict(message):
28
  with st.status("Requesting Palm-2🌴..."):
29
  st.write("Requesting API...")
30
+ response = bard.get_answer(message+'Rule 1: If User requires a code snippet, write each code snippet only in that way that it would run in streamlit app.')
31
  st.write("Done...")
32
 
33
  st.write("Checking images...")
34
+ for i in response['images']:
35
  st.image(i)
36
+ if response['code']:
37
+ exec(response['code'])
38
  return response['content']
39
 
40
  # Streamlit UI