nanohit2 commited on
Commit
08890be
·
verified ·
1 Parent(s): 54a2c3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -64,6 +64,7 @@ def analyze(text):
64
  "error": str(e)
65
  }
66
 
 
67
  demo = gr.Interface(
68
  fn=analyze,
69
  inputs=gr.Textbox(
@@ -82,8 +83,15 @@ demo = gr.Interface(
82
  ["It's okay, nothing special."],
83
  ["Привет, как дела?"],
84
  ["Это ужасно, я в ярости!"]
85
- ]
 
86
  )
87
 
88
  if __name__ == "__main__":
89
- demo.launch(server_name="0.0.0.0", server_port=7860, ssr_mode=False, show_api=True)
 
 
 
 
 
 
 
64
  "error": str(e)
65
  }
66
 
67
+ # Create the interface with explicit api_name
68
  demo = gr.Interface(
69
  fn=analyze,
70
  inputs=gr.Textbox(
 
83
  ["It's okay, nothing special."],
84
  ["Привет, как дела?"],
85
  ["Это ужасно, я в ярости!"]
86
+ ],
87
+ api_name="predict" # Explicitly set the API name
88
  )
89
 
90
  if __name__ == "__main__":
91
+ demo.queue() # Add queue for better performance
92
+ demo.launch(
93
+ server_name="0.0.0.0",
94
+ server_port=7860,
95
+ show_api=True,
96
+ share=False # Don't use share=True on HF Spaces
97
+ )