AMR-KELEG commited on
Commit
baffbf0
·
1 Parent(s): b6f7a4c

Fix the model class

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,7 +7,7 @@ import streamlit as st
7
 
8
  import torch
9
  import datasets
10
- from transformers import AutoModel, AutoTokenizer
11
 
12
  model_name = st.text_input("Enter a model's name on HF")
13
  # MODEL_NAME = "AMR-KELEG/NADI2024-baseline"
@@ -33,7 +33,7 @@ DIALECTS = ["Algeria",
33
  assert len(DIALECTS) == 18
34
 
35
  tokenizer = AutoTokenizer.from_pretrained(model_name)
36
- model = AutoModel.from_pretrained(model_name)
37
 
38
  def predict_top_p(text, P=0.9):
39
  """Predict the top dialects with an accumulative confidence of at least P."""
 
7
 
8
  import torch
9
  import datasets
10
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
11
 
12
  model_name = st.text_input("Enter a model's name on HF")
13
  # MODEL_NAME = "AMR-KELEG/NADI2024-baseline"
 
33
  assert len(DIALECTS) == 18
34
 
35
  tokenizer = AutoTokenizer.from_pretrained(model_name)
36
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
37
 
38
  def predict_top_p(text, P=0.9):
39
  """Predict the top dialects with an accumulative confidence of at least P."""