Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,9 @@ def initialize_llm(model_choice):
|
|
26 |
return None
|
27 |
return ChatOpenAI(api_key=openai_api_key, model="gpt-4o")
|
28 |
|
|
|
|
|
|
|
29 |
|
30 |
def load_dataset_into_session():
|
31 |
input_option = st.radio(
|
@@ -73,23 +76,6 @@ def load_dataset_into_session():
|
|
73 |
|
74 |
st.title("Chat with Patent Dataset Using PandasAI")
|
75 |
|
76 |
-
# Push instructions to the sidebar
|
77 |
-
with st.sidebar:
|
78 |
-
st.header("Instructions")
|
79 |
-
st.markdown(
|
80 |
-
"1. Select how you want to input the dataset.\n"
|
81 |
-
"2. Upload, select, or fetch the dataset using the provided options.\n"
|
82 |
-
"3. Choose an LLM (Groq-based or OpenAI-based) to interact with the data.\n"
|
83 |
-
" - Example: 'Predict if the patent will be accepted.'\n"
|
84 |
-
" - Example: 'What is the primary classification of this patent?'\n"
|
85 |
-
" - Example: 'Summarize the abstract of this patent.'\n"
|
86 |
-
"4. Enter a query to generate and view graphs based on patent attributes.\n"
|
87 |
-
)
|
88 |
-
|
89 |
-
# Select LLM model
|
90 |
-
model_choice = st.radio("Select LLM", ["GPT-4o", "llama-3.3-70b"], index=0, horizontal=True)
|
91 |
-
llm = initialize_llm(model_choice)
|
92 |
-
|
93 |
# Load dataset into session
|
94 |
load_dataset_into_session()
|
95 |
|
@@ -127,3 +113,16 @@ if "df" in st.session_state and llm:
|
|
127 |
|
128 |
except Exception as e:
|
129 |
st.error(f"Error: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
return None
|
27 |
return ChatOpenAI(api_key=openai_api_key, model="gpt-4o")
|
28 |
|
29 |
+
# Select LLM model
|
30 |
+
model_choice = st.radio("Select LLM", ["GPT-4o", "llama-3.3-70b"], index=0, horizontal=True)
|
31 |
+
llm = initialize_llm(model_choice)
|
32 |
|
33 |
def load_dataset_into_session():
|
34 |
input_option = st.radio(
|
|
|
76 |
|
77 |
st.title("Chat with Patent Dataset Using PandasAI")
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
# Load dataset into session
|
80 |
load_dataset_into_session()
|
81 |
|
|
|
113 |
|
114 |
except Exception as e:
|
115 |
st.error(f"Error: {e}")
|
116 |
+
|
117 |
+
# Push instructions to the sidebar
|
118 |
+
with st.sidebar:
|
119 |
+
st.header("Instructions")
|
120 |
+
st.markdown(
|
121 |
+
"1. Select how you want to input the dataset.\n"
|
122 |
+
"2. Upload, select, or fetch the dataset using the provided options.\n"
|
123 |
+
"3. Choose an LLM (Groq-based or OpenAI-based) to interact with the data.\n"
|
124 |
+
" - Example: 'Predict if the patent will be accepted.'\n"
|
125 |
+
" - Example: 'What is the primary classification of this patent?'\n"
|
126 |
+
" - Example: 'Summarize the abstract of this patent.'\n"
|
127 |
+
"4. Enter a query to generate and view graphs based on patent attributes.\n"
|
128 |
+
)
|