zafirabdullah12 commited on
Commit
cfaff52
·
verified ·
1 Parent(s): 0129b24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,7 +1,6 @@
1
  # Importing Libraries
2
  import os
3
  os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
4
- os.environ['GRADIO_HOT_RELOAD'] = '0' # Disable hot reload to prevent threading errors
5
 
6
  import re
7
  import nltk
@@ -174,8 +173,8 @@ def create_gradio_interface():
174
  ["I'm okay"]
175
  ]
176
 
177
- # Create interface
178
- with gr.Blocks(title="Sentiment Analysis", theme=gr.themes.Soft()) as interface:
179
 
180
  # Header
181
  gr.Markdown("""
@@ -265,16 +264,18 @@ if __name__ == "__main__":
265
  print("🚀 Starting Sentiment Analysis Gradio Interface...")
266
  print("=" * 70 + "\n")
267
 
268
- # Create and launch interface
269
  interface = create_gradio_interface()
270
 
271
- # Launch with configuration
 
272
  interface.launch(
273
  server_name="0.0.0.0",
274
  server_port=7860,
275
  share=False,
276
  show_error=True,
277
- quiet=False
 
278
  )
279
 
280
  print("\n" + "=" * 70)
 
1
  # Importing Libraries
2
  import os
3
  os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
 
4
 
5
  import re
6
  import nltk
 
173
  ["I'm okay"]
174
  ]
175
 
176
+ # Create interface - theme removed to avoid Gradio 6.0 warning
177
+ with gr.Blocks(title="Sentiment Analysis") as interface:
178
 
179
  # Header
180
  gr.Markdown("""
 
264
  print("🚀 Starting Sentiment Analysis Gradio Interface...")
265
  print("=" * 70 + "\n")
266
 
267
+ # Create interface
268
  interface = create_gradio_interface()
269
 
270
+ # Launch with configuration - theme moved here for Gradio 6.0+
271
+ # ssr_mode=False disables server-side rendering and the hot reload issue
272
  interface.launch(
273
  server_name="0.0.0.0",
274
  server_port=7860,
275
  share=False,
276
  show_error=True,
277
+ ssr_mode=False, # This disables SSR and prevents the hot reload error
278
+ theme=gr.themes.Soft()
279
  )
280
 
281
  print("\n" + "=" * 70)