Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,9 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
st.header("Intro to Deep learining")
|
| 4 |
|
|
@@ -7,4 +12,20 @@ st.subheader("What is AI")
|
|
| 7 |
st.markdown("""AI stands for artificail Intelligence,In a simple term we can define AI as a huge field where we are going to make machine's mimic
|
| 8 |
human intelligence.
|
| 9 |
|
| 10 |
-
As we know we human beigns are having Natural Intelligence using which we are able to perform day to day task.And this intelligence we trained """)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import openai
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
import os
|
| 6 |
+
os.environ["OPENAI_API_KEY"]="sk-proj-uHasdgbriPPlFMm99ZtJT3BlbkFJOl231YfdxCSNmQjVEpMX"
|
| 7 |
|
| 8 |
st.header("Intro to Deep learining")
|
| 9 |
|
|
|
|
| 12 |
st.markdown("""AI stands for artificail Intelligence,In a simple term we can define AI as a huge field where we are going to make machine's mimic
|
| 13 |
human intelligence.
|
| 14 |
|
| 15 |
+
As we know we human beigns are having Natural Intelligence using which we are able to perform day to day task.And this intelligence we trained """)
|
| 16 |
+
|
| 17 |
+
st.button("Reset", type="primary")
|
| 18 |
+
if st.button("Answer from gpt"):
|
| 19 |
+
responds=openai.chat.completions.create(
|
| 20 |
+
model="gpt-3.5-turbo",
|
| 21 |
+
messages=[
|
| 22 |
+
{"role": "system", "content": "you are a very good assistant"},# set the behaviour of
|
| 23 |
+
{"role": "user", "content": "What do we mean by ai"}
|
| 24 |
+
],
|
| 25 |
+
temperature=0,
|
| 26 |
+
max_tokens=200
|
| 27 |
+
|
| 28 |
+
)
|
| 29 |
+
st.write(responds.choices[0].message.content)
|
| 30 |
+
else:
|
| 31 |
+
st.write("thx")
|