Upload folder using huggingface_hub
Browse files- README.md +1 -1
- app/__pycache__/__init__.cpython-310.pyc +0 -0
- app/__pycache__/openai_chat_completion.cpython-310.pyc +0 -0
- app/app.py +30 -0
- requirements.txt +1 -0
README.md
CHANGED
@@ -3,6 +3,6 @@ title: Kaleidoscope Data - LLM Data Cleaner
|
|
3 |
emoji: 🧹
|
4 |
sdk: streamlit
|
5 |
sdk_version: 1.24.0
|
6 |
-
app_file:
|
7 |
pinned: false
|
8 |
---
|
|
|
3 |
emoji: 🧹
|
4 |
sdk: streamlit
|
5 |
sdk_version: 1.24.0
|
6 |
+
app_file: app.py
|
7 |
pinned: false
|
8 |
---
|
app/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (159 Bytes). View file
|
|
app/__pycache__/openai_chat_completion.cpython-310.pyc
ADDED
Binary file (2.53 kB). View file
|
|
app/app.py
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# this app is streamlit app for the current project hosted on huggingface spaces
|
2 |
+
|
3 |
+
import streamlit as st
|
4 |
+
from openai_chat_completion import OpenAIChatCompletions
|
5 |
+
|
6 |
+
st.title("Kaleidoscope Data - Data Cleaning LLM App")
|
7 |
+
|
8 |
+
st.write("This app is a demo of the LLM model for data cleaning. It is a work in progress and is not yet ready for production use.")
|
9 |
+
|
10 |
+
# text box or csv upload
|
11 |
+
text_input = st.text_input("Enter text", "")
|
12 |
+
# csv_file = st.file_uploader("Upload CSV", type=['csv'])
|
13 |
+
|
14 |
+
# button to run data cleaning API on text via c class in openai_chat_completion.py
|
15 |
+
if st.button("Run Data Cleaning API"):
|
16 |
+
|
17 |
+
# if text_input is not empty, run data cleaning API on text_input
|
18 |
+
|
19 |
+
model = "gpt-4" # "gpt-3.5-turbo"
|
20 |
+
sys_mes = "prompts/gpt4-system-message.txt"
|
21 |
+
|
22 |
+
# instantiate OpenAIChatCompletions class
|
23 |
+
# get response from openai_chat_completion method
|
24 |
+
chat = OpenAIChatCompletions(model=model, system_message=sys_mes)
|
25 |
+
response = chat.openai_chat_completion(text_input, n_shot=5)
|
26 |
+
|
27 |
+
|
28 |
+
# display response
|
29 |
+
st.write(response['choices'][0]['message']['content'])
|
30 |
+
|
requirements.txt
CHANGED
@@ -5,3 +5,4 @@ pandas==2.0.2
|
|
5 |
python-dotenv==1.0.0
|
6 |
scikit_learn==1.2.2
|
7 |
tenacity==8.2.2
|
|
|
|
5 |
python-dotenv==1.0.0
|
6 |
scikit_learn==1.2.2
|
7 |
tenacity==8.2.2
|
8 |
+
streamlit==1.24.0
|