Update app.py
Browse files
app.py
CHANGED
@@ -54,28 +54,6 @@ st.write('Your input is ', yourquestion)
|
|
54 |
|
55 |
|
56 |
|
57 |
-
if st.button("Ask for ideas "):
|
58 |
-
template = """
|
59 |
-
You are an AI assistant.
|
60 |
-
{concept}
|
61 |
-
"""
|
62 |
-
|
63 |
-
yourquestionideas = "List creative ideas of " + yourquestion
|
64 |
-
|
65 |
-
response = openai.ChatCompletion.create(
|
66 |
-
engine="gpt-35-turbo",
|
67 |
-
messages = [{"role":"system","content":"You are an AI assistant that can come up with creative product ideas."},{"role":"user","content":yourquestionideas}],
|
68 |
-
temperature=0.99,
|
69 |
-
max_tokens=800,
|
70 |
-
top_p=1,
|
71 |
-
frequency_penalty=0,
|
72 |
-
presence_penalty=0,
|
73 |
-
stop=None)
|
74 |
-
|
75 |
-
# Run the chain only specifying the input variable.
|
76 |
-
st.write(response)
|
77 |
-
|
78 |
-
|
79 |
if st.button("Visuvalize for ideas "):
|
80 |
body = { "caption": yourquestion , "resolution": "512x512" }
|
81 |
|
@@ -98,86 +76,24 @@ if st.button("Visuvalize for ideas "):
|
|
98 |
st.image(image_url, width = 512)
|
99 |
|
100 |
|
101 |
-
if
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
yourquestionideas = "Tell me a creative idea of " + yourquestion + " like i am a ten"
|
108 |
-
|
109 |
-
response = openai.ChatCompletion.create(
|
110 |
-
engine="gpt-35-turbo",
|
111 |
-
messages = [{"role":"system","content":"You are an AI assistant that can come up with creative product ideas."},{"role":"user","content":yourquestionideas}],
|
112 |
-
temperature=0.99,
|
113 |
-
max_tokens=800,
|
114 |
-
top_p=1,
|
115 |
-
frequency_penalty=0,
|
116 |
-
presence_penalty=0,
|
117 |
-
stop=None)
|
118 |
-
|
119 |
-
# Run the chain only specifying the input variable.
|
120 |
-
st.write(response)
|
121 |
-
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
presence_penalty=0,
|
138 |
-
stop=None)
|
139 |
-
|
140 |
-
# Run the chain only specifying the input variable.
|
141 |
-
st.write(response)
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
if st.button("Ask trying here "):
|
148 |
-
template = """
|
149 |
-
You are an expert on topics of Sustainability, Climate action and UN Sustainable Development Goals.
|
150 |
-
Explain the concept of {concept} like i am a five
|
151 |
-
"""
|
152 |
-
|
153 |
-
prompt = PromptTemplate(
|
154 |
-
input_variables=["concept"],
|
155 |
-
template=template,
|
156 |
-
)
|
157 |
-
|
158 |
-
|
159 |
-
from langchain.chains import LLMChain
|
160 |
-
chain = LLMChain(llm=llm, prompt=prompt)
|
161 |
-
|
162 |
-
# Run the chain only specifying the input variable.
|
163 |
-
st.write(chain.run(yourquestion))
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
if st.button("Ask Hindi "):
|
168 |
-
template = """
|
169 |
-
You are an expert on topics of Sustainability, Climate action and UN Sustainable Development Goals.
|
170 |
-
Explain the concept of {concept} in Hindi
|
171 |
-
"""
|
172 |
-
|
173 |
-
prompt = PromptTemplate(
|
174 |
-
input_variables=["concept"],
|
175 |
-
template=template,
|
176 |
-
)
|
177 |
-
|
178 |
-
|
179 |
-
from langchain.chains import LLMChain
|
180 |
-
chain = LLMChain(llm=llm, prompt=prompt)
|
181 |
-
|
182 |
-
# Run the chain only specifying the input variable.
|
183 |
-
st.write(chain.run(yourquestion))
|
|
|
54 |
|
55 |
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
if st.button("Visuvalize for ideas "):
|
58 |
body = { "caption": yourquestion , "resolution": "512x512" }
|
59 |
|
|
|
76 |
st.image(image_url, width = 512)
|
77 |
|
78 |
|
79 |
+
if True==False:
|
80 |
+
if st.button("Ask for ideas "):
|
81 |
+
template = """
|
82 |
+
You are an AI assistant.
|
83 |
+
{concept}
|
84 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
+
yourquestionideas = "List creative ideas of " + yourquestion
|
87 |
+
|
88 |
+
response = openai.ChatCompletion.create(
|
89 |
+
engine="gpt-35-turbo",
|
90 |
+
messages = [{"role":"system","content":"You are an AI assistant that can come up with creative product ideas."},{"role":"user","content":yourquestionideas}],
|
91 |
+
temperature=0.99,
|
92 |
+
max_tokens=800,
|
93 |
+
top_p=1,
|
94 |
+
frequency_penalty=0,
|
95 |
+
presence_penalty=0,
|
96 |
+
stop=None)
|
97 |
+
|
98 |
+
# Run the chain only specifying the input variable.
|
99 |
+
st.write(response)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|