Spaces:
Sleeping
Sleeping
instantiate zero
Browse files
app.py
CHANGED
|
@@ -3,12 +3,12 @@ from transformers import pipeline
|
|
| 3 |
import pandas as pd
|
| 4 |
import spaces
|
| 5 |
|
| 6 |
-
# Load
|
| 7 |
from datasets import load_dataset
|
| 8 |
ds = load_dataset('ZennyKenny/demo_customer_nps')
|
| 9 |
df = pd.DataFrame(ds['train'])
|
| 10 |
|
| 11 |
-
# Initialize
|
| 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 = []
|