Skip to content

Commit

Permalink
Fixed dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Mestuq committed Aug 11, 2023
1 parent 2228eac commit 9247e53
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 3 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,42 @@ I prefere to consider both models during choosing tags to paste into my videos,
7. **Suggested tags**
These models gives us the coefficient (or feature importances) numbers that we can use to predict tags that will give us the most of views. Sorted from the higher impact.

## Installing

### Via docker

Run following line

```
docker build -t tagsai:mestuq .
docker run -p 5000:5000 --name TagsAI tagsai:mestuq
```

Website is avalible in http://127.0.0.1:5000/ .

### Via python script

Install required

```
pip install -r requirements.txt
```

Or use lock files avalible in "Lock files" folder.

```
pipenv shell
pipenv install --ignore-pipfile
```

Then run

```
python "www/main.py"
```

Website is avalible in http://127.0.0.1:5000/ .

## Future plans

- Currently im not considering "date of uploading" as a predictor.
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ yt_dlp
numpy
pandas==1.5.3
scikit-learn
imblearn
imblearn
matplotlib
2 changes: 1 addition & 1 deletion www/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

if __name__ == '__main__':
app.debug = True
socketio.run(app, port=5000, debug=True)
socketio.run(app, port=5000, debug=True, allow_unsafe_werkzeug=True, host='0.0.0.0')
4 changes: 4 additions & 0 deletions www/routes/favoritesBP.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
favorites_bp = Blueprint('favorites', __name__)

def getFavorites():

if not os.path.exists("favorites/"):
os.makedirs("favorites/")

name_set = set()
# List all files in the favorites folder
file_list = os.listdir("favorites/")
Expand Down
3 changes: 2 additions & 1 deletion www/routes/tagsBP.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def GetTags(Amount):
# Save result
coefficients_df.head(Amount).to_csv('LinearRegression.csv', encoding='utf-8', index=False)
except Exception as e:
socketio.emit('errorOccured',{'errorContent': str(e)}, namespace='/test')
print("EXPECTION--------------------------------------------------")
print(e)
socketio.emit('errorOccured',{'errorContent': str(e)}, namespace='/test')

# RANDOM FOREST -------------------------------------------------------------

Expand Down Expand Up @@ -106,6 +106,7 @@ def GetTags(Amount):
except Exception as e:
print("EXPECTION--------------------------------------------------")
print(e)
socketio.emit('errorOccured',{'errorContent': str(e)}, namespace='/test')
# ------------------------------------------------------------------------------

# FINISHING PROCESS
Expand Down
12 changes: 12 additions & 0 deletions www/routes/videosBP.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def processSearchForYoutubeVideos():
return render_template('process.html')

def getListOfDownloadedChannels():

if not os.path.exists("downloaded/"):
os.makedirs("downloaded/")

file_names_without_extension = []
for file_name in os.listdir("downloaded/"):
# Check if it's a file and not a directory
Expand All @@ -52,6 +56,10 @@ def getListOfDownloadedChannels():

@videos_bp.route('/concatChannels', methods=['POST'])
def concatChannels():

if not os.path.exists("downloaded/"):
os.makedirs("downloaded/")

selected_channels = []
form_data = request.form

Expand Down Expand Up @@ -82,6 +90,10 @@ def concatChannels():


def searchForYoutubeVideos(PagesNumber,ReplaceCSV):

if not os.path.exists("downloaded/"):
os.makedirs("downloaded/")

time.sleep(1) # Waiting for client to load the website
print("=============STARTING==============")
# PREPARING DATA
Expand Down

0 comments on commit 9247e53

Please sign in to comment.