Skip to content

Commit

Permalink
hackintosh
Browse files Browse the repository at this point in the history
  • Loading branch information
teticio committed Sep 28, 2021
1 parent 5520171 commit 2ae1f61
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
8 changes: 8 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
"DOCS_URL": "/docs",
"REDOC_URL": "/redoc"
},
"osx": {
"env": {
"APP_URL": "http://localhost:3000",
"DOCS_URL": "/docs",
"REDOC_URL": "/redoc",
"HACKINTOSH": "1"
}
},
"module": "uvicorn",
"args": [
"backend.main:app",
Expand Down
7 changes: 5 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
"name": "Deej-A.I.",
"slug": "DeejAI",
"entryPoint": "./src/index.native.js",
"version": "2.0.0",
"version": "2.0.1",
"userInterfaceStyle": "dark",
"android": {
"package": "online.deejai",
"versionCode": 1
},
"ios": {
"bundleIdentifier": "online.deej-ai",
"buildNumber": "2.0.0"
"buildNumber": "1",
"supportsTablet": true,
"backgroundColor": "#000000",
"userInterfaceStyle": "dark"
}
}
}
16 changes: 9 additions & 7 deletions backend/deejai.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
import numpy as np
from starlette.concurrency import run_in_threadpool

import tensorflow as tf
from keras.models import load_model
if 'HACKINTOSH' not in os.environ: # can't get tensorflow to work on Hackintosh due to missing AVX support
import tensorflow as tf
from keras.models import load_model


class DeejAI:
Expand Down Expand Up @@ -46,11 +47,12 @@ def __init__(self):
self.mp3tovecs = np.array([[mp3tovecs[_], tracktovecs[_]]
for _ in mp3tovecs])
del mp3tovecs, tracktovecs
self.model = load_model('speccy_model',
custom_objects={
'cosine_proximity':
tf.compat.v1.keras.losses.cosine_proximity
})
if 'HACKINTOSH' not in os.environ:
self.model = load_model('speccy_model',
custom_objects={
'cosine_proximity':
tf.compat.v1.keras.losses.cosine_proximity
})

def get_tracks(self):
"""Get tracks.
Expand Down
4 changes: 1 addition & 3 deletions src/index.native.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// TODO:
// Routes
// Previous
// Footer
// Spotify login
Expand All @@ -14,8 +13,7 @@ import App from './components/App';
global.Buffer = global.Buffer || require('buffer').Buffer;
global.localStorage = global.localStorage || require('localStorage');

//process.env.REACT_APP_API_URL = 'https://deej-ai.online/api/v1';
process.env.REACT_APP_API_URL = 'http://192.168.0.225:8001/api/v1';
process.env.REACT_APP_API_URL = 'https://deej-ai.online/api/v1';

const theme = {
...DarkTheme,
Expand Down

0 comments on commit 2ae1f61

Please sign in to comment.