saisi commited on
Commit
7840152
1 Parent(s): f59595f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -1,17 +1,15 @@
1
  import streamlit as st
2
- import transformers
3
- import torch
4
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
5
 
6
- # Define the paths of the pre-trained models
7
- model1_path = "saisi/finetuned-Sentiment-classfication-ROBERTA-model"
8
- model2_path = "saisi/finetuned-Sentiment-classfication-DISTILBERT-model"
9
 
10
  # Initialize the tokenizer and models for sentiment analysis
11
- tokenizer1 = AutoTokenizer.from_pretrained(model1_path)
12
- model1 = AutoModelForSequenceClassification.from_pretrained(model1_path)
13
- tokenizer2 = AutoTokenizer.from_pretrained(model2_path)
14
- model2 = AutoModelForSequenceClassification.from_pretrained(model2_path)
15
 
16
  # Define a function to preprocess the text data
17
  def preprocess(text):
 
1
  import streamlit as st
 
 
2
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
 
4
+ # Define the model names or identifiers
5
+ model1_name = "saisi/finetuned-Sentiment-classfication-ROBERTA-model"
6
+ model2_name = "saisi/finetuned-Sentiment-classfication-DISTILBERT-model"
7
 
8
  # Initialize the tokenizer and models for sentiment analysis
9
+ tokenizer1 = AutoTokenizer.from_pretrained(model1_name)
10
+ model1 = AutoModelForSequenceClassification.from_pretrained(model1_name)
11
+ tokenizer2 = AutoTokenizer.from_pretrained(model2_name)
12
+ model2 = AutoModelForSequenceClassification.from_pretrained(model2_name)
13
 
14
  # Define a function to preprocess the text data
15
  def preprocess(text):