rviana commited on
Commit
6179462
·
1 Parent(s): bbd3459

Fix GRADIO version.

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -9,6 +9,13 @@ def classify_text(text):
9
  result = classifier(text)[0]
10
  return f"{result['label']} with score {result['score']}"
11
 
12
- # Set up the Gradio interface
13
- iface = gr.Interface(fn=classify_text, inputs="text", outputs="text")
14
- iface.launch(server_port=7861)
 
 
 
 
 
 
 
 
9
  result = classifier(text)[0]
10
  return f"{result['label']} with score {result['score']}"
11
 
12
+ # Check if GRADIO_SERVER_PORT is set, otherwise use a different port
13
+ import os
14
+ port = int(os.getenv('GRADIO_SERVER_PORT', 7861))
15
+
16
+ # Launch the Gradio interface on the specified port
17
+ iface.launch(server_port=port)
18
+
19
+ # Streamlit code
20
+ st.title('IMDb Sentiment Analysis')
21
+ st.write('This project performs sentiment analysis on IMDb movie reviews using Streamlit.')