Saima335
commited on
Commit
·
a23d62f
1
Parent(s):
0c1a788
folder update
Browse files- src/streamlit_app.py +6 -6
- uploads/.gitkeep +0 -0
src/streamlit_app.py
CHANGED
@@ -10,10 +10,10 @@ import os
|
|
10 |
from PIL import Image
|
11 |
|
12 |
app = Flask(__name__)
|
13 |
-
UPLOAD_FOLDER = "
|
14 |
-
os.makedirs(UPLOAD_FOLDER, exist_ok=True)
|
15 |
|
16 |
-
@app.route('/
|
17 |
def uploaded_file(filename):
|
18 |
return send_from_directory(app.config['UPLOAD_FOLDER'], filename)
|
19 |
|
@@ -106,10 +106,10 @@ def analyze():
|
|
106 |
wordcloud = WordCloud(width=800, height=400, background_color='white', font_path='src/urdu_font.ttf').generate(all_text)
|
107 |
|
108 |
# Save in uploads folder
|
109 |
-
if not os.path.exists("
|
110 |
-
|
111 |
|
112 |
-
wordcloud_path = os.path.join("
|
113 |
wordcloud.to_file(wordcloud_path)
|
114 |
|
115 |
# Convert image to base64
|
|
|
10 |
from PIL import Image
|
11 |
|
12 |
app = Flask(__name__)
|
13 |
+
UPLOAD_FOLDER = "uploads"
|
14 |
+
# os.makedirs(UPLOAD_FOLDER, exist_ok=True)
|
15 |
|
16 |
+
@app.route('/uploads/<filename>')
|
17 |
def uploaded_file(filename):
|
18 |
return send_from_directory(app.config['UPLOAD_FOLDER'], filename)
|
19 |
|
|
|
106 |
wordcloud = WordCloud(width=800, height=400, background_color='white', font_path='src/urdu_font.ttf').generate(all_text)
|
107 |
|
108 |
# Save in uploads folder
|
109 |
+
# if not os.path.exists("uploads"):
|
110 |
+
# os.makedirs("uploads")
|
111 |
|
112 |
+
wordcloud_path = os.path.join("uploads", f"wordcloud{uuid.uuid4()}.png")
|
113 |
wordcloud.to_file(wordcloud_path)
|
114 |
|
115 |
# Convert image to base64
|
uploads/.gitkeep
ADDED
File without changes
|