Saima0 commited on
Commit
792826f
·
verified ·
1 Parent(s): 5082e28

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +2 -2
src/streamlit_app.py CHANGED
@@ -19,7 +19,7 @@ def uploaded_file(filename):
19
 
20
  # Load model and tokenizer once
21
  tokenizer = BertTokenizer.from_pretrained("bert-base-multilingual-cased")
22
- model_path = "./emotion_final_model"
23
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
24
  model = BertForSequenceClassification.from_pretrained(model_path).to(device)
25
  model.eval()
@@ -103,7 +103,7 @@ def analyze():
103
  aspect_summary[aspect]["total"] += 1
104
 
105
  # Generate WordCloud
106
- wordcloud = WordCloud(width=800, height=400, background_color='white', font_path='urdu_font.ttf').generate(all_text)
107
 
108
  # Save in uploads folder
109
  if not os.path.exists("uploads"):
 
19
 
20
  # Load model and tokenizer once
21
  tokenizer = BertTokenizer.from_pretrained("bert-base-multilingual-cased")
22
+ model_path = "./src/emotion_final_model"
23
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
24
  model = BertForSequenceClassification.from_pretrained(model_path).to(device)
25
  model.eval()
 
103
  aspect_summary[aspect]["total"] += 1
104
 
105
  # Generate WordCloud
106
+ wordcloud = WordCloud(width=800, height=400, background_color='white', font_path='src/urdu_font.ttf').generate(all_text)
107
 
108
  # Save in uploads folder
109
  if not os.path.exists("uploads"):