Stanford-TH commited on
Commit
6f79036
1 Parent(s): 24f25d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  from transformers import pipeline
 
3
 
4
  # Load the genre prediction model as a pipeline
5
  pipe = pipeline(model="Stanford-TH/GenrePrediction", trust_remote_code=True)
@@ -8,7 +9,7 @@ def classify_movie_genre(description):
8
  # Get predictions using the pipeline
9
  predictions = pipe(description)
10
 
11
- return [predictions]
12
 
13
  # Define the Gradio interface
14
  iface = gr.Interface(
 
1
  import gradio as gr
2
  from transformers import pipeline
3
+ import pandas as pd
4
 
5
  # Load the genre prediction model as a pipeline
6
  pipe = pipeline(model="Stanford-TH/GenrePrediction", trust_remote_code=True)
 
9
  # Get predictions using the pipeline
10
  predictions = pipe(description)
11
 
12
+ return pd.DataFrame([predictions])
13
 
14
  # Define the Gradio interface
15
  iface = gr.Interface(