Spaces:
Sleeping
Sleeping
fix (app): adjust in ports
Browse files
Dockerfile
CHANGED
|
@@ -10,4 +10,4 @@ COPY --chown=user ./requirements.txt requirements.txt
|
|
| 10 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 11 |
|
| 12 |
COPY --chown=user ./app /app
|
| 13 |
-
CMD ["uvicorn", "server_factory_predictor:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 10 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 11 |
|
| 12 |
COPY --chown=user ./app /app
|
| 13 |
+
CMD ["uvicorn", "server_factory_predictor:app", "--host", "0.0.0.0", "--port", "7860"]
|
app/server_factory_predictor.py
CHANGED
|
@@ -16,7 +16,7 @@ app.mount("/app/static", StaticFiles(directory="static"), name="static")
|
|
| 16 |
|
| 17 |
app.add_middleware(
|
| 18 |
CORSMiddleware,
|
| 19 |
-
allow_origins=["http://127.0.0.1:5173","http://localhost:5173","http://127.0.0.1:
|
| 20 |
allow_credentials=True,
|
| 21 |
allow_methods=["*"],
|
| 22 |
allow_headers=["*"],
|
|
|
|
| 16 |
|
| 17 |
app.add_middleware(
|
| 18 |
CORSMiddleware,
|
| 19 |
+
allow_origins=["http://127.0.0.1:5173","http://localhost:5173","http://127.0.0.1:7860","http://localhost:7860"],
|
| 20 |
allow_credentials=True,
|
| 21 |
allow_methods=["*"],
|
| 22 |
allow_headers=["*"],
|
app/static/editor/js/editor-rest.js
CHANGED
|
@@ -6,7 +6,7 @@ Oid.customize('oid:rest', {
|
|
| 6 |
api: {
|
| 7 |
oas: {
|
| 8 |
paths: {
|
| 9 |
-
'http://127.0.0.1:
|
| 10 |
'post': {
|
| 11 |
operationId: 'train',
|
| 12 |
parameters: [
|
|
@@ -19,7 +19,7 @@ Oid.customize('oid:rest', {
|
|
| 19 |
]
|
| 20 |
}
|
| 21 |
},
|
| 22 |
-
'http://127.0.0.1:
|
| 23 |
'get': {
|
| 24 |
operationId: 'predict',
|
| 25 |
parameters: [
|
|
@@ -48,12 +48,12 @@ Oid.customize('oid:rest', {
|
|
| 48 |
api: {
|
| 49 |
oas: {
|
| 50 |
paths: {
|
| 51 |
-
'http://127.0.0.1:
|
| 52 |
'post': {
|
| 53 |
operationId: 'train'
|
| 54 |
}
|
| 55 |
},
|
| 56 |
-
'http://127.0.0.1:
|
| 57 |
'post': {
|
| 58 |
operationId: 'temperature',
|
| 59 |
parameters: [
|
|
@@ -63,7 +63,7 @@ Oid.customize('oid:rest', {
|
|
| 63 |
]
|
| 64 |
}
|
| 65 |
},
|
| 66 |
-
'http://127.0.0.1:
|
| 67 |
'post': {
|
| 68 |
operationId: 'pressure',
|
| 69 |
parameters: [
|
|
|
|
| 6 |
api: {
|
| 7 |
oas: {
|
| 8 |
paths: {
|
| 9 |
+
'http://127.0.0.1:7860/train?train_path={train_path}&test_path={test_path}': {
|
| 10 |
'post': {
|
| 11 |
operationId: 'train',
|
| 12 |
parameters: [
|
|
|
|
| 19 |
]
|
| 20 |
}
|
| 21 |
},
|
| 22 |
+
'http://127.0.0.1:7860/predict?radius_mean={radius_mean}&texture_mean={texture_mean}&symmetry_mean={symmetry_mean}&fractal_dimension_mean={fractal_dimension_mean}': {
|
| 23 |
'get': {
|
| 24 |
operationId: 'predict',
|
| 25 |
parameters: [
|
|
|
|
| 48 |
api: {
|
| 49 |
oas: {
|
| 50 |
paths: {
|
| 51 |
+
'http://127.0.0.1:7860/train': {
|
| 52 |
'post': {
|
| 53 |
operationId: 'train'
|
| 54 |
}
|
| 55 |
},
|
| 56 |
+
'http://127.0.0.1:7860/inform_temperature?value={value}': {
|
| 57 |
'post': {
|
| 58 |
operationId: 'temperature',
|
| 59 |
parameters: [
|
|
|
|
| 63 |
]
|
| 64 |
}
|
| 65 |
},
|
| 66 |
+
'http://127.0.0.1:7860/inform_pressure?value={value}': {
|
| 67 |
'post': {
|
| 68 |
operationId: 'pressure',
|
| 69 |
parameters: [
|
app/static/gallery/factory-ai.html
CHANGED
|
@@ -33,8 +33,10 @@
|
|
| 33 |
<slider-oid min="40" max="200" value="40" index publish="change~predictor/pressure">
|
| 34 |
</slider-oid>
|
| 35 |
</span>
|
| 36 |
-
<
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
| 40 |
</div>
|
|
|
|
| 33 |
<slider-oid min="40" max="200" value="40" index publish="change~predictor/pressure">
|
| 34 |
</slider-oid>
|
| 35 |
</span>
|
| 36 |
+
<span id="ml-proxy">
|
| 37 |
+
<rest-oid custom="factory-predictor"
|
| 38 |
+
subscribe="predictor/train~post/train;predictor/temperature~post/temperature;predictor/pressure~post/pressure"
|
| 39 |
+
publish="dispatch~update/alert">
|
| 40 |
+
</rest-oid>
|
| 41 |
+
</span>
|
| 42 |
</div>
|