furrutiav commited on
Commit
d9c22e0
·
1 Parent(s): aaf2b84

Create new file

Browse files
Files changed (1) hide show
  1. util.py +11 -0
util.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import torch
3
+ from transformers import BertTokenizer, BertModel
4
+ from huggingface_hub import hf_hub_url, cached_download
5
+
6
+ def get_cls_layer():
7
+ config_file_url = hf_hub_url("furrutiav/beto_coherence", filename="cls_layer.torch")
8
+ value = cached_download(config_file_url)
9
+ return torch.load(value, map_location=torch.device('cpu'))
10
+
11
+ get_cls_layer()