mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-02 16:23:58 +03:00
upda
This commit is contained in:
parent
49072f2b35
commit
796d494826
@ -7,6 +7,7 @@ from fastapi import FastAPI, UploadFile, File, Form
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.encoders import jsonable_encoder
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from pydantic import BaseModel
|
||||
|
||||
from scipy.io.wavfile import write, read
|
||||
@ -137,6 +138,7 @@ if __name__ == thisFilename:
|
||||
return {"result": "Index"}
|
||||
|
||||
|
||||
# Can colab receive post request "ONLY" at root path?
|
||||
@app_fastapi.post("/upload_model_file")
|
||||
async def upload_file(configFile:UploadFile = File(...), modelFile: UploadFile = File(...)):
|
||||
if configFile and modelFile:
|
||||
@ -151,6 +153,30 @@ if __name__ == thisFilename:
|
||||
return {"Error": "uploaded file is not found."}
|
||||
|
||||
|
||||
@app_fastapi.get("/resumable")
|
||||
async def get_resumble():
|
||||
print("GET REQUSET")
|
||||
raise HTTPException(status_code=404, detail="Not found")
|
||||
|
||||
return 'OK'
|
||||
|
||||
@app_fastapi.post("/resumable")
|
||||
async def post_resumble(
|
||||
file:UploadFile = File(...),
|
||||
filename: str = Form(...)
|
||||
):
|
||||
|
||||
print("resumableFilename", filename)
|
||||
if file and filename:
|
||||
filename = file.filename + "_" + filename
|
||||
fileobj = file.file
|
||||
upload_dir = open(os.path.join(".", filename),'wb+')
|
||||
shutil.copyfileobj(fileobj, upload_dir)
|
||||
upload_dir.close()
|
||||
return {"uploaded files": f"{filename} "}
|
||||
return {"Error": "uploaded file is not found."}
|
||||
return 'OK'
|
||||
|
||||
|
||||
@app_fastapi.post("/test")
|
||||
async def post_test(voice:VoiceModel):
|
||||
|
14
frontend/dist/index.html
vendored
14
frontend/dist/index.html
vendored
@ -1 +1,13 @@
|
||||
<!doctype html><html lang="ja" style="width:100%;height:100%;overflow:hidden"><head><meta charset="utf-8"/><title>voice recorder</title><script defer="defer" src="index.js"></script></head><body style="width:100%;height:100%;margin:0"><div id="app" style="width:100%;height:100%"></div><noscript><strong>javascriptを有効にしてください</strong></noscript></body></html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja" style="width: 100%; height: 100%; overflow: hidden">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>voice recorder</title>
|
||||
<script defer src="index.js"></script></head>
|
||||
<body style="width: 100%; height: 100%; margin: 0px">
|
||||
<div id="app" style="width: 100%; height: 100%"></div>
|
||||
<noscript>
|
||||
<strong>javascriptを有効にしてください</strong>
|
||||
</noscript>
|
||||
</body>
|
||||
</html>
|
||||
|
4820
frontend/dist/index.js
vendored
4820
frontend/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
FROM dannadori/voice-changer-internal:20221030_013959 as front
|
||||
FROM dannadori/voice-changer-internal:20221030_185857 as front
|
||||
FROM debian:bullseye-slim as base
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
Loading…
Reference in New Issue
Block a user