Chris4K commited on
Commit
0065a7e
·
verified ·
1 Parent(s): d4ecf4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -1,4 +1,14 @@
1
- from transformers.tools.base import launch_gradio_demo
2
  from sentiment_analysis import SentimentAnalysisTool
3
 
4
- launch_gradio_demo(SentimentAnalysisTool)
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from sentiment_analysis import SentimentAnalysisTool
2
 
3
+ # Create an instance of the tool
4
+ sentiment_tool = SentimentAnalysisTool()
5
+
6
+ # Launch the Gradio interface
7
+ if __name__ == "__main__":
8
+ import gradio as gr
9
+
10
+ gr.Interface(
11
+ fn=sentiment_tool,
12
+ inputs=gr.Textbox(label="Text to analyze"),
13
+ outputs=gr.JSON(label="Sentiment Analysis Results")
14
+ ).launch(share=True)