Spaces:
Sleeping
Sleeping
Update back.py
Browse files
back.py
CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
|
|
2 |
import numpy as np
|
3 |
import torch
|
4 |
|
5 |
-
from typing import TypeVar
|
6 |
from transformers import DistilBertTokenizer
|
7 |
|
8 |
|
@@ -42,7 +42,7 @@ label_mapping = {
|
|
42 |
}
|
43 |
|
44 |
|
45 |
-
def load_setup(path_to_model: str, path_to_vocab: str) ->
|
46 |
loaded_model = torch.load(path_to_model, map_location=device)
|
47 |
loaded_tokenizer = DistilBertTokenizer(path_to_vocab)
|
48 |
return loaded_model, loaded_tokenizer
|
|
|
2 |
import numpy as np
|
3 |
import torch
|
4 |
|
5 |
+
from typing import TypeVar, Tuple
|
6 |
from transformers import DistilBertTokenizer
|
7 |
|
8 |
|
|
|
42 |
}
|
43 |
|
44 |
|
45 |
+
def load_setup(path_to_model: str, path_to_vocab: str) -> Tuple[ModelType, TokenizerType]:
|
46 |
loaded_model = torch.load(path_to_model, map_location=device)
|
47 |
loaded_tokenizer = DistilBertTokenizer(path_to_vocab)
|
48 |
return loaded_model, loaded_tokenizer
|