Update the model loading module
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import torch
|
|
| 4 |
import pandas as pd
|
| 5 |
import streamlit as st
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
-
from transformers import
|
| 8 |
from constants import DIALECTS
|
| 9 |
|
| 10 |
import altair as alt
|
|
@@ -83,7 +83,7 @@ def convert_df(df):
|
|
| 83 |
|
| 84 |
@st.cache_resource
|
| 85 |
def load_model(model_name):
|
| 86 |
-
model =
|
| 87 |
return model
|
| 88 |
|
| 89 |
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
import streamlit as st
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 8 |
from constants import DIALECTS
|
| 9 |
|
| 10 |
import altair as alt
|
|
|
|
| 83 |
|
| 84 |
@st.cache_resource
|
| 85 |
def load_model(model_name):
|
| 86 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 87 |
return model
|
| 88 |
|
| 89 |
|