deeksonparlma commited on
Commit ·
5fd48dd
1
Parent(s): acfca9e
predict
Browse files
app.py
CHANGED
|
@@ -11,6 +11,8 @@
|
|
| 11 |
|
| 12 |
# Path: app.py
|
| 13 |
import pickle
|
|
|
|
|
|
|
| 14 |
import gradio as gr
|
| 15 |
|
| 16 |
# install transformers and torch in requirements.txt
|
|
@@ -31,7 +33,9 @@ def classify_text(inp):
|
|
| 31 |
# vectorizer = TfidfVectorizer()
|
| 32 |
# X = vectorizer.fit_transform(inp)
|
| 33 |
# reshape the input to 2D
|
| 34 |
-
|
|
|
|
|
|
|
| 35 |
return model.predict(inp)
|
| 36 |
|
| 37 |
|
|
|
|
| 11 |
|
| 12 |
# Path: app.py
|
| 13 |
import pickle
|
| 14 |
+
|
| 15 |
+
import numpy as np
|
| 16 |
import gradio as gr
|
| 17 |
|
| 18 |
# install transformers and torch in requirements.txt
|
|
|
|
| 33 |
# vectorizer = TfidfVectorizer()
|
| 34 |
# X = vectorizer.fit_transform(inp)
|
| 35 |
# reshape the input to 2D
|
| 36 |
+
# convert the input to a numpy array
|
| 37 |
+
array = np.array(inp)
|
| 38 |
+
inp = array.reshape(-1, 1)
|
| 39 |
return model.predict(inp)
|
| 40 |
|
| 41 |
|