Spaces:
Sleeping

SoniaD commited on
Commit
015e936
·
verified ·
1 Parent(s): 54c9dd2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import pandas as pd
3
  from transformers import pipeline
4
  from collections import Counter
5
  import re
 
6
 
7
  # Use Finetuned model as classifier of the text
8
  model_id = "SoniaD/CustomModel_Uber"
@@ -12,6 +13,9 @@ classifier = pipeline("text-classification", model=model_id, tokenizer=model_id)
12
  problem_extractor = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
13
  zero_classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
14
 
 
 
 
15
  # Clean the text uploaded
16
  def clean_text(text):
17
  return re.sub(r'\s+', ' ', str(text)).strip()
 
3
  from transformers import pipeline
4
  from collections import Counter
5
  import re
6
+ from transformers import AutoTokenizer
7
 
8
  # Use Finetuned model as classifier of the text
9
  model_id = "SoniaD/CustomModel_Uber"
 
13
  problem_extractor = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
14
  zero_classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
15
 
16
+ # Load tokenizer separately for token count check
17
+ tokenizer = AutoTokenizer.from_pretrained("SoniaD/CustomModel_Uber")
18
+
19
  # Clean the text uploaded
20
  def clean_text(text):
21
  return re.sub(r'\s+', ' ', str(text)).strip()