Peter Moc commited on
Commit
8979155
·
verified ·
1 Parent(s): 8f10967

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -2,12 +2,13 @@ import streamlit as st
2
  from transformers import AutoModelForSequenceClassification, AutoTokenizer
3
  import torch
4
 
5
- # Specify the Hugging Face model repository
6
- model_name = "DanKoan/kiwi-classifier"
 
7
 
8
  # Load the model and tokenizer from the Hugging Face Hub
9
- model = AutoModelForSequenceClassification.from_pretrained(model_name)
10
- tokenizer = AutoTokenizer.from_pretrained(model_name)
11
 
12
  # Function to predict the sentiment
13
  def predict_sentiment(text):
 
2
  from transformers import AutoModelForSequenceClassification, AutoTokenizer
3
  import torch
4
 
5
+ # Paths to the saved model and tokenizer
6
+ model_path = "path_to_save_model"
7
+ tokenizer_path = "path_to_save_tokenizer"
8
 
9
  # Load the model and tokenizer from the Hugging Face Hub
10
+ model = AutoModelForSequenceClassification.from_pretrained(model_path)
11
+ tokenizer = AutoTokenizer.from_pretrained(tokenizer_path)
12
 
13
  # Function to predict the sentiment
14
  def predict_sentiment(text):