Spaces:
Build error
Build error
Update lab/interim.py
Browse files- lab/interim.py +13 -13
lab/interim.py
CHANGED
|
@@ -128,8 +128,8 @@ if "df" in st.session_state and llm:
|
|
| 128 |
chat_df = SmartDataframe(df, config={"llm": llm})
|
| 129 |
|
| 130 |
# Chat functionality
|
| 131 |
-
st.write("### Chat with
|
| 132 |
-
user_query = st.text_input("Enter your question about the patent data
|
| 133 |
|
| 134 |
if user_query:
|
| 135 |
try:
|
|
@@ -140,7 +140,7 @@ if "df" in st.session_state and llm:
|
|
| 140 |
|
| 141 |
# Plot generation functionality
|
| 142 |
st.write("### Generate and View Graphs")
|
| 143 |
-
plot_query = st.text_input("Enter a query to generate a graph
|
| 144 |
|
| 145 |
if plot_query:
|
| 146 |
try:
|
|
@@ -157,17 +157,17 @@ if "df" in st.session_state and llm:
|
|
| 157 |
st.error(f"Error: {e}")
|
| 158 |
|
| 159 |
# Download processed dataset
|
| 160 |
-
st.write("### Download Processed Dataset")
|
| 161 |
-
st.download_button(
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
)
|
| 167 |
|
| 168 |
# Sidebar instructions
|
| 169 |
with st.sidebar:
|
| 170 |
-
st.header("Instructions:")
|
| 171 |
st.markdown(
|
| 172 |
"1. Choose an LLM (Groq-based or OpenAI-based) to interact with the data.\n"
|
| 173 |
"2. Upload, select, or fetch the dataset using the provided options.\n"
|
|
@@ -177,7 +177,7 @@ with st.sidebar:
|
|
| 177 |
" - Example: 'Summarize the abstract of this patent.'\n"
|
| 178 |
)
|
| 179 |
st.markdown("---")
|
| 180 |
-
st.header("References:")
|
| 181 |
st.markdown(
|
| 182 |
"1. [Chat With Your CSV File With PandasAI - Prince Krampah](https://medium.com/aimonks/chat-with-your-csv-file-with-pandasai-22232a13c7b7)"
|
| 183 |
-
)
|
|
|
|
| 128 |
chat_df = SmartDataframe(df, config={"llm": llm})
|
| 129 |
|
| 130 |
# Chat functionality
|
| 131 |
+
st.write("### Chat with Patent Data")
|
| 132 |
+
user_query = st.text_input("Enter your question about the patent data:", value = "Have the patents with the numbers 14908945, 14994130, 14909084, and 14995057 been accepted or rejected? What are their titles?")
|
| 133 |
|
| 134 |
if user_query:
|
| 135 |
try:
|
|
|
|
| 140 |
|
| 141 |
# Plot generation functionality
|
| 142 |
st.write("### Generate and View Graphs")
|
| 143 |
+
plot_query = st.text_input("Enter a query to generate a graph:", value = "What is the distribution of patents categorized as 'ACCEPTED', 'REJECTED', or 'PENDING'?")
|
| 144 |
|
| 145 |
if plot_query:
|
| 146 |
try:
|
|
|
|
| 157 |
st.error(f"Error: {e}")
|
| 158 |
|
| 159 |
# Download processed dataset
|
| 160 |
+
#st.write("### Download Processed Dataset")
|
| 161 |
+
#st.download_button(
|
| 162 |
+
# label="Download Dataset as CSV",
|
| 163 |
+
# data=df.to_csv(index=False),
|
| 164 |
+
# file_name="processed_dataset.csv",
|
| 165 |
+
# mime="text/csv"
|
| 166 |
+
#)
|
| 167 |
|
| 168 |
# Sidebar instructions
|
| 169 |
with st.sidebar:
|
| 170 |
+
st.header("π Instructions:")
|
| 171 |
st.markdown(
|
| 172 |
"1. Choose an LLM (Groq-based or OpenAI-based) to interact with the data.\n"
|
| 173 |
"2. Upload, select, or fetch the dataset using the provided options.\n"
|
|
|
|
| 177 |
" - Example: 'Summarize the abstract of this patent.'\n"
|
| 178 |
)
|
| 179 |
st.markdown("---")
|
| 180 |
+
st.header("π References:")
|
| 181 |
st.markdown(
|
| 182 |
"1. [Chat With Your CSV File With PandasAI - Prince Krampah](https://medium.com/aimonks/chat-with-your-csv-file-with-pandasai-22232a13c7b7)"
|
| 183 |
+
)
|