forked from open-webui/open-webui
refac: convert str var to f-string
This commit is contained in:
parent
5b26d2a686
commit
d2c5f3d591
4 changed files with 14 additions and 9 deletions
|
@ -2,5 +2,5 @@ from peewee import *
|
|||
from config import DATA_DIR
|
||||
|
||||
|
||||
DB = SqliteDatabase(str(DATA_DIR / "ollama.db"))
|
||||
DB = SqliteDatabase(f"{DATA_DIR}/ollama.db")
|
||||
DB.connect()
|
||||
|
|
|
@ -96,7 +96,7 @@ async def download(
|
|||
file_name = parse_huggingface_url(url)
|
||||
|
||||
if file_name:
|
||||
file_path = str(UPLOAD_DIR / file_name)
|
||||
file_path = f"{UPLOAD_DIR}/{file_name}"
|
||||
|
||||
return StreamingResponse(
|
||||
download_file_stream(url, file_path, file_name),
|
||||
|
@ -108,7 +108,7 @@ async def download(
|
|||
|
||||
@router.post("/upload")
|
||||
def upload(file: UploadFile = File(...)):
|
||||
file_path = UPLOAD_DIR / file.filename
|
||||
file_path = f"{UPLOAD_DIR}/{file.filename}"
|
||||
|
||||
# Save file in chunks
|
||||
with file_path.open("wb+") as f:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue