Spaces:
Running
Running
Younesse Kaddar
commited on
Commit
·
b8cf9fa
1
Parent(s):
c3e31ca
update
Browse files- .env.example +3 -0
- .gitignore +3 -1
- app2.py +40 -0
- requirements.txt +6 -0
.env.example
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
OPENAI_API_KEY=
|
2 |
+
PINECONE_ENV=
|
3 |
+
PINECONE_API_KEY=
|
.gitignore
CHANGED
@@ -357,4 +357,6 @@ pyrightconfig.json
|
|
357 |
### VisualStudioCode Patch ###
|
358 |
# Ignore all local history of files
|
359 |
.history
|
360 |
-
.ionide
|
|
|
|
|
|
357 |
### VisualStudioCode Patch ###
|
358 |
# Ignore all local history of files
|
359 |
.history
|
360 |
+
.ionide
|
361 |
+
|
362 |
+
.streamlit
|
app2.py
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
# Import the LangChain library
|
4 |
+
import langchain
|
5 |
+
|
6 |
+
# Load the AI model
|
7 |
+
model = langchain.load_model("model.pkl")
|
8 |
+
|
9 |
+
# Create a function to get the feedback from the AI model
|
10 |
+
def get_feedback(statement):
|
11 |
+
# Get the predictions from the AI model
|
12 |
+
predictions = model.predict(statement)
|
13 |
+
|
14 |
+
# Create a list of feedback
|
15 |
+
feedback = []
|
16 |
+
for prediction in predictions:
|
17 |
+
feedback.append(prediction["feedback"])
|
18 |
+
|
19 |
+
return feedback
|
20 |
+
|
21 |
+
# Create a function to display the feedback
|
22 |
+
def display_feedback(statement):
|
23 |
+
# Get the feedback from the AI model
|
24 |
+
feedback = get_feedback(statement)
|
25 |
+
|
26 |
+
# Display the feedback to the user
|
27 |
+
st.write("Here is the feedback from the AI model:")
|
28 |
+
st.write(feedback)
|
29 |
+
|
30 |
+
# Create a main function
|
31 |
+
def main():
|
32 |
+
# Get the personal statement from the user
|
33 |
+
statement = st.text_input("Enter your personal statement:")
|
34 |
+
|
35 |
+
# Display the feedback to the user
|
36 |
+
display_feedback(statement)
|
37 |
+
|
38 |
+
# Run the main function
|
39 |
+
if __name__ == "__main__":
|
40 |
+
main()
|
requirements.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
openai
|
2 |
+
anthropic
|
3 |
+
streamlit
|
4 |
+
langchain
|
5 |
+
python-dotenv
|
6 |
+
pinecone-client
|