Update app.py
Browse files
app.py
CHANGED
|
@@ -53,6 +53,14 @@ Categorize the website into one of the 3 categories:
|
|
| 53 |
outputs = model.generate(**inputs, max_new_tokens=64, use_cache=True)
|
| 54 |
ans = tokenizer.batch_decode(outputs)[0]
|
| 55 |
ans_pred = ans.split('### Response:')[1].split('<')[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
return ans_pred
|
| 57 |
|
| 58 |
except Exception as e:
|
|
|
|
| 53 |
outputs = model.generate(**inputs, max_new_tokens=64, use_cache=True)
|
| 54 |
ans = tokenizer.batch_decode(outputs)[0]
|
| 55 |
ans_pred = ans.split('### Response:')[1].split('<')[0]
|
| 56 |
+
|
| 57 |
+
if 'OTHER' in ans_pred:
|
| 58 |
+
ans_pred = 'OTHER'
|
| 59 |
+
elif 'NEWS/BLOG' in ans_pred:
|
| 60 |
+
ans_pred = 'NEWS/BLOG'
|
| 61 |
+
elif 'E-commerce' in ans_pred:
|
| 62 |
+
ans_pred = 'E-commerce'
|
| 63 |
+
|
| 64 |
return ans_pred
|
| 65 |
|
| 66 |
except Exception as e:
|