Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,15 @@ import transformers
|
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
4 |
import os
|
|
|
5 |
os.environ['HF_KEY']='sk-proj-uHasdgbriPPlFMm99ZtJT3BlbkFJOl231YfdxCSNmQjVEpMX'
|
6 |
|
7 |
input=st.text_input("Enter the text")
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
4 |
import os
|
5 |
+
import openai
|
6 |
os.environ['HF_KEY']='sk-proj-uHasdgbriPPlFMm99ZtJT3BlbkFJOl231YfdxCSNmQjVEpMX'
|
7 |
|
8 |
input=st.text_input("Enter the text")
|
9 |
+
response=openai.chat.completions.create(
|
10 |
+
model="gpt-3.5-turbo",
|
11 |
+
messages=[
|
12 |
+
{"role": "system", "content": "Hello!, How can I assist you"},
|
13 |
+
{'role':'user','content':input}
|
14 |
+
]
|
15 |
+
)
|
16 |
+
st.write(response.choices[0].message.content)
|