Spaces:
Runtime error
Runtime error
nehalelkaref
commited on
Commit
•
26ce2b9
1
Parent(s):
abd4a0f
first push
Browse files- app.py +2 -2
- templates/index.html +19 -0
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from flask import Flask, jsonify, request
|
2 |
from transformers import AutoAdapterModel, AutoTokenizer, TextClassificationPipeline
|
3 |
from huggingface_hub import Repository
|
4 |
|
@@ -23,7 +23,7 @@ app = Flask(__name__)
|
|
23 |
|
24 |
@app.route("/", methods=['GET'])
|
25 |
def home():
|
26 |
-
return
|
27 |
|
28 |
if __name__ == "__main__":
|
29 |
app.run()
|
|
|
1 |
+
from flask import Flask, jsonify, request, render_template
|
2 |
from transformers import AutoAdapterModel, AutoTokenizer, TextClassificationPipeline
|
3 |
from huggingface_hub import Repository
|
4 |
|
|
|
23 |
|
24 |
@app.route("/", methods=['GET'])
|
25 |
def home():
|
26 |
+
return render_template('index.html')
|
27 |
|
28 |
if __name__ == "__main__":
|
29 |
app.run()
|
templates/index.html
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<main>
|
2 |
+
<section id="text-gen">
|
3 |
+
<h2>Region Detection</h2>
|
4 |
+
|
5 |
+
<body>
|
6 |
+
|
7 |
+
<div align="center" class="bg-info">
|
8 |
+
<h1>Spam detector for Youtube comments</h1></div>
|
9 |
+
<div class="big" align="center">
|
10 |
+
<form action="{{url_for('classify')}}" method="POST">
|
11 |
+
<h3>Enter Your Text Here</h3>
|
12 |
+
<textarea name="comment" rows="4" cols="50"></textarea>
|
13 |
+
<br>
|
14 |
+
<input type="submit" name="" value="Predict" class="btn btn-info">
|
15 |
+
</form>
|
16 |
+
</div>
|
17 |
+
</body>
|
18 |
+
</section>
|
19 |
+
</main>
|