soufyane commited on
Commit
248d588
1 Parent(s): a6aa62a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -15,11 +15,13 @@ classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
15
 
16
 
17
  # Function to process a single text input
 
18
  def analyze_text(text):
19
  result = classifier(text)[0]
20
  return result
21
 
22
  # Function to process a CSV file and update results live
 
23
  def analyze_csv(file,nrows=400):
24
  df = pd.read_csv(file.name)
25
  texts = df['text'].tolist()
 
15
 
16
 
17
  # Function to process a single text input
18
+ @spaces.GPU
19
  def analyze_text(text):
20
  result = classifier(text)[0]
21
  return result
22
 
23
  # Function to process a CSV file and update results live
24
+ @spaces.GPU
25
  def analyze_csv(file,nrows=400):
26
  df = pd.read_csv(file.name)
27
  texts = df['text'].tolist()