Spaces:
Sleeping
Sleeping
swastik-kapture
commited on
Commit
·
2f4ef39
1
Parent(s):
3450292
Update to app
Browse files- .gitignore +2 -0
- app.py +3 -1
- requirements.txt +1 -0
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
venv
|
| 2 |
+
.env
|
app.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
|
|
| 1 |
import time
|
| 2 |
import streamlit as st
|
|
|
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
# Model to load
|
|
@@ -7,7 +9,7 @@ MODEL_TO_LOAD = "swastik-kapture/offenseval-xlmr"
|
|
| 7 |
TOKENIZER = "xlm-roberta-base"
|
| 8 |
|
| 9 |
# create classification pipeline
|
| 10 |
-
trained_model = pipeline("text-classification", model=MODEL_TO_LOAD, tokenizer=TOKENIZER, token="
|
| 11 |
|
| 12 |
# Streamlit App
|
| 13 |
def main():
|
|
|
|
| 1 |
+
import os
|
| 2 |
import time
|
| 3 |
import streamlit as st
|
| 4 |
+
from dotenv import load_dotenv
|
| 5 |
from transformers import pipeline
|
| 6 |
|
| 7 |
# Model to load
|
|
|
|
| 9 |
TOKENIZER = "xlm-roberta-base"
|
| 10 |
|
| 11 |
# create classification pipeline
|
| 12 |
+
trained_model = pipeline("text-classification", model=MODEL_TO_LOAD, tokenizer=TOKENIZER, token=os.environ.get("HF_READ_KEY"))
|
| 13 |
|
| 14 |
# Streamlit App
|
| 15 |
def main():
|
requirements.txt
CHANGED
|
@@ -41,6 +41,7 @@ pyarrow==13.0.0
|
|
| 41 |
pydeck==0.8.1b0
|
| 42 |
Pygments==2.16.1
|
| 43 |
python-dateutil==2.8.2
|
|
|
|
| 44 |
pytz==2023.3.post1
|
| 45 |
PyYAML==6.0.1
|
| 46 |
referencing==0.30.2
|
|
|
|
| 41 |
pydeck==0.8.1b0
|
| 42 |
Pygments==2.16.1
|
| 43 |
python-dateutil==2.8.2
|
| 44 |
+
python-dotenv==1.0.0
|
| 45 |
pytz==2023.3.post1
|
| 46 |
PyYAML==6.0.1
|
| 47 |
referencing==0.30.2
|