ZennyKenny commited on
Commit
ec6871c
Β·
verified Β·
1 Parent(s): 3b1d1cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -21,6 +21,7 @@ classifier = pipeline("text-classification", model="distilbert/distilbert-base-u
21
  generator = pipeline("text2text-generation", model="google/flan-t5-base")
22
 
23
  # Function to classify customer comments
 
24
  def classify_comments(categories):
25
  global df # Ensure we're modifying the global DataFrame
26
  sentiments = []
@@ -50,6 +51,7 @@ def classify_comments(categories):
50
  return df[['customer_id', 'customer_comment', 'comment_sentiment', 'comment_category', 'customer_nps', 'customer_segment']].to_html(index=False)
51
 
52
  # Function to generate visualizations
 
53
  def visualize_output():
54
  global df
55
 
 
21
  generator = pipeline("text2text-generation", model="google/flan-t5-base")
22
 
23
  # Function to classify customer comments
24
+ @spaces.GPU
25
  def classify_comments(categories):
26
  global df # Ensure we're modifying the global DataFrame
27
  sentiments = []
 
51
  return df[['customer_id', 'customer_comment', 'comment_sentiment', 'comment_category', 'customer_nps', 'customer_segment']].to_html(index=False)
52
 
53
  # Function to generate visualizations
54
+ @spaces.GPU
55
  def visualize_output():
56
  global df
57