Spaces:
Sleeping
Sleeping
albin
commited on
Commit
·
4a2b74d
1
Parent(s):
4fe11fa
convert features into numeric values
Browse files
main.py
CHANGED
|
@@ -96,6 +96,8 @@ async def predict(request: Request, requess: Req = Depends(form_req)):
|
|
| 96 |
data.append(features['DegitRatioInURL'])
|
| 97 |
data.append(features['SpacialCharRatioInURL'])
|
| 98 |
data.append(features['IsHTTPS'])
|
|
|
|
|
|
|
| 99 |
|
| 100 |
prediction = model.predict([data])
|
| 101 |
output = prediction[0]
|
|
|
|
| 96 |
data.append(features['DegitRatioInURL'])
|
| 97 |
data.append(features['SpacialCharRatioInURL'])
|
| 98 |
data.append(features['IsHTTPS'])
|
| 99 |
+
# Convert every feature into numeric value
|
| 100 |
+
data = [float(x) if isinstance(x, str) else x for x in data]
|
| 101 |
|
| 102 |
prediction = model.predict([data])
|
| 103 |
output = prediction[0]
|