We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 144ef73 commit 6dbcc1cCopy full SHA for 6dbcc1c
.gitignore
@@ -0,0 +1 @@
1
+__pycache__
Procfile
+web: gunicorn app:app
app.py
@@ -0,0 +1,20 @@
+import random
2
+
3
+from flask import Flask, jsonify
4
+from datasets import DownloadMode, load_dataset
5
6
+app = Flask(__name__)
7
8
+print('Downloading the dataset...')
9
+masader = load_dataset('arbml/masader')
10
11
12
+@app.route('/datasets')
13
+def datasets():
14
+ global masader
15
16
+ if random.random() <= 0.1:
17
+ print('Re-downloading the dataset...')
18
+ masader = load_dataset('arbml/masader', download_mode=DownloadMode.FORCE_REDOWNLOAD)
19
20
+ return jsonify(list(masader['train']))
requirements.txt
@@ -0,0 +1,3 @@
+Flask==2.1.2
+datasets==2.3.2
+gunicorn==20.1.0
0 commit comments