ogirald0 commited on
Commit
31615ab
·
1 Parent(s): 6b9ab28

Simplified app to show text analyzer directly

Browse files
Files changed (1) hide show
  1. app.py +8 -28
app.py CHANGED
@@ -6,33 +6,13 @@ import logging
6
  logging.basicConfig(level=logging.INFO)
7
  logger = logging.getLogger(__name__)
8
 
9
- def create_demo():
10
- # Initialize models
11
- logger.info("Initializing models...")
12
- text_classification_model = TextClassificationModel()
13
- # Add more models here as needed
14
-
15
- # Create the interfaces
16
- logger.info("Creating Gradio interfaces...")
17
- text_classification_demo = text_classification_model.create_interface()
18
- # Add more model interfaces here
19
-
20
- # Create a tabbed interface
21
- demo = gr.TabbedInterface(
22
- interface_list=[
23
- text_classification_demo,
24
- # Add more interfaces here
25
- ],
26
- tab_names=[
27
- "Text Classification",
28
- # Add more tab names here
29
- ],
30
- title="Oversai Models Hub",
31
- description="A collection of AI models for various tasks"
32
- )
33
-
34
- return demo
35
 
36
- # Create and launch the demo
37
- demo = create_demo()
 
 
 
38
  demo.launch()
 
6
  logging.basicConfig(level=logging.INFO)
7
  logger = logging.getLogger(__name__)
8
 
9
+ # Initialize model
10
+ logger.info("Initializing Text Classification model...")
11
+ model = TextClassificationModel()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
+ # Create the interface
14
+ logger.info("Creating Gradio interface...")
15
+ demo = model.create_interface()
16
+
17
+ # Launch the interface
18
  demo.launch()