Spaces:
Sleeping
Sleeping
Commit
·
399a77d
1
Parent(s):
a9541a4
update cuda cpu
Browse files- app.py +4 -0
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,8 +1,12 @@
|
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
from transformers import pipeline
|
4 |
import base64
|
5 |
|
|
|
|
|
|
|
6 |
# Load pipelines
|
7 |
sentiment_pipe = pipeline("text-classification", model="ayameRushia/bert-base-indonesian-1.5G-sentiment-analysis-smsa")
|
8 |
emotion_pipe = pipeline("text-classification", model="azizp128/prediksi-emosi-indobert")
|
|
|
1 |
+
import os
|
2 |
import streamlit as st
|
3 |
import pandas as pd
|
4 |
from transformers import pipeline
|
5 |
import base64
|
6 |
|
7 |
+
# Set to use CPU only
|
8 |
+
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
|
9 |
+
|
10 |
# Load pipelines
|
11 |
sentiment_pipe = pipeline("text-classification", model="ayameRushia/bert-base-indonesian-1.5G-sentiment-analysis-smsa")
|
12 |
emotion_pipe = pipeline("text-classification", model="azizp128/prediksi-emosi-indobert")
|
requirements.txt
CHANGED
@@ -2,5 +2,6 @@ transformers
|
|
2 |
streamlit
|
3 |
pandas
|
4 |
tensorflow
|
|
|
5 |
torch
|
6 |
tf-keras
|
|
|
2 |
streamlit
|
3 |
pandas
|
4 |
tensorflow
|
5 |
+
tensorflow-cpu
|
6 |
torch
|
7 |
tf-keras
|