ZennyKenny commited on
Commit
a32f02f
Β·
verified Β·
1 Parent(s): 3ae1eb6

instantiate zero

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -3,12 +3,12 @@ from transformers import pipeline
3
  import pandas as pd
4
  import spaces
5
 
6
- # Load the dataset
7
  from datasets import load_dataset
8
  ds = load_dataset('ZennyKenny/demo_customer_nps')
9
  df = pd.DataFrame(ds['train'])
10
 
11
- # Initialize the model pipeline
12
  from huggingface_hub import login
13
  import os
14
 
@@ -20,6 +20,7 @@ classifier = pipeline("text-classification", model="distilbert/distilbert-base-u
20
  generator = pipeline("text2text-generation", model="google/flan-t5-base")
21
 
22
  # Function to classify customer comments
 
23
  def classify_comments():
24
  sentiments = []
25
  categories = []
 
3
  import pandas as pd
4
  import spaces
5
 
6
+ # Load dataset
7
  from datasets import load_dataset
8
  ds = load_dataset('ZennyKenny/demo_customer_nps')
9
  df = pd.DataFrame(ds['train'])
10
 
11
+ # Initialize model pipeline
12
  from huggingface_hub import login
13
  import os
14
 
 
20
  generator = pipeline("text2text-generation", model="google/flan-t5-base")
21
 
22
  # Function to classify customer comments
23
+ @spaces.GPU #https://huggingface.co/docs/hub/spaces-zerogpu
24
  def classify_comments():
25
  sentiments = []
26
  categories = []