cn91 commited on
Commit
2609434
1 Parent(s): f6cb372

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
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