Spaces:
Runtime error
Runtime error
Create new file
Browse files
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()
|