'mint autosave'
Browse files- Dockerfile +1 -1
- app.py +2 -3
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 1 |
+
FROM python:3.8.9
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
app.py
CHANGED
|
@@ -12,12 +12,11 @@ def analyze(input, model):
|
|
| 12 |
|
| 13 |
#text insert
|
| 14 |
input = st.text_area("insert text to be analyzed", value="Nice to see you today.", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, placeholder=None, disabled=False, label_visibility="visible")
|
| 15 |
-
model_name = st.text_input("choose a transformer model", value="")
|
| 16 |
if model_name:
|
| 17 |
model = TFAutoModelForSequenceClassification.from_pretrained(model_name)
|
| 18 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 19 |
classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
|
| 20 |
-
|
| 21 |
else:
|
| 22 |
classifier = pipeline('sentiment-analysis')
|
| 23 |
|
|
@@ -25,5 +24,5 @@ else:
|
|
| 25 |
if st.button('Analyze'):
|
| 26 |
st.write(classifier(input))
|
| 27 |
else:
|
| 28 |
-
st.write('
|
| 29 |
|
|
|
|
| 12 |
|
| 13 |
#text insert
|
| 14 |
input = st.text_area("insert text to be analyzed", value="Nice to see you today.", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, placeholder=None, disabled=False, label_visibility="visible")
|
| 15 |
+
model_name = st.text_input("choose a transformer model (nothing for default)", value="")
|
| 16 |
if model_name:
|
| 17 |
model = TFAutoModelForSequenceClassification.from_pretrained(model_name)
|
| 18 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 19 |
classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
|
|
|
|
| 20 |
else:
|
| 21 |
classifier = pipeline('sentiment-analysis')
|
| 22 |
|
|
|
|
| 24 |
if st.button('Analyze'):
|
| 25 |
st.write(classifier(input))
|
| 26 |
else:
|
| 27 |
+
st.write('Excited to analyze!')
|
| 28 |
|