Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
WORD_PROBABILITY_THRESHOLD = 0.02
|
2 |
#WORD_PROBABILITY_THRESHOLD_ENGLISH = 0.02
|
3 |
#WORD_PROBABILITY_THRESHOLD_CHINESE = 0.02
|
|
|
1 |
+
from transformers import pipeline, AutoTokenizer
|
2 |
+
import pandas as pd
|
3 |
+
import numpy as np
|
4 |
+
import torch
|
5 |
+
import streamlit as st
|
6 |
+
|
7 |
+
USE_GPU = True
|
8 |
+
|
9 |
+
if USE_GPU and torch.cuda.is_available():
|
10 |
+
device = torch.device("cuda:0")
|
11 |
+
else:
|
12 |
+
device = torch.device('cpu')
|
13 |
+
|
14 |
+
|
15 |
WORD_PROBABILITY_THRESHOLD = 0.02
|
16 |
#WORD_PROBABILITY_THRESHOLD_ENGLISH = 0.02
|
17 |
#WORD_PROBABILITY_THRESHOLD_CHINESE = 0.02
|