admin08077 commited on
Commit
8af3a88
·
verified ·
1 Parent(s): fb842c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -8,10 +8,6 @@ from sklearn.feature_extraction.text import CountVectorizer
8
  from sklearn.ensemble import RandomForestClassifier
9
  from sklearn.pipeline import Pipeline
10
  import joblib
11
- import warnings
12
-
13
- # Suppress specific warnings if necessary
14
- warnings.filterwarnings("ignore", category=UserWarning, module="gradio.components.chatbot")
15
 
16
  # Initialize the HuggingFace API Client with a valid model
17
  # Replace 'gpt-3.5-turbo' with your desired model if different
@@ -132,15 +128,14 @@ with gr.Blocks() as demo:
132
 
133
  with gr.Tab("💬 Chat"):
134
  chatbot = gr.Chatbot(label="AI Chatbot", type="messages") # Specify type='messages'
135
- # Removed .style(height=600) as it's deprecated
136
 
137
  with gr.Row():
138
- with gr.Column(scale=0.85):
139
  user_input = gr.Textbox(
140
  label="Your Message",
141
  placeholder="Type your message here...",
142
  )
143
- with gr.Column(scale=0.15, min_width=100):
144
  send_button = gr.Button("Send", variant="primary")
145
  with gr.Row():
146
  system_message = gr.Textbox(
@@ -183,7 +178,7 @@ with gr.Blocks() as demo:
183
  file_upload = gr.File(
184
  label="Upload CSV File",
185
  file_types=[".csv"],
186
- multiple=False,
187
  interactive=True,
188
  )
189
  upload_output = gr.Textbox(label="Upload Result", interactive=False)
 
8
  from sklearn.ensemble import RandomForestClassifier
9
  from sklearn.pipeline import Pipeline
10
  import joblib
 
 
 
 
11
 
12
  # Initialize the HuggingFace API Client with a valid model
13
  # Replace 'gpt-3.5-turbo' with your desired model if different
 
128
 
129
  with gr.Tab("💬 Chat"):
130
  chatbot = gr.Chatbot(label="AI Chatbot", type="messages") # Specify type='messages'
 
131
 
132
  with gr.Row():
133
+ with gr.Column(scale=5): # Changed from 0.85 to 5
134
  user_input = gr.Textbox(
135
  label="Your Message",
136
  placeholder="Type your message here...",
137
  )
138
+ with gr.Column(scale=1, min_width=100): # Changed from 0.15 to 1
139
  send_button = gr.Button("Send", variant="primary")
140
  with gr.Row():
141
  system_message = gr.Textbox(
 
178
  file_upload = gr.File(
179
  label="Upload CSV File",
180
  file_types=[".csv"],
181
+ file_count="single", # Replaced 'multiple=False' with 'file_count="single"'
182
  interactive=True,
183
  )
184
  upload_output = gr.Textbox(label="Upload Result", interactive=False)