Add llamacpp python scripts

This commit is contained in:
kwaroran
2024-01-12 12:11:58 +09:00
parent b4b461288d
commit 70daaff160
4 changed files with 71 additions and 1 deletions

13
src-python/run.py Normal file
View File

@@ -0,0 +1,13 @@
import uvicorn
import os
import uuid
import subprocess
import sys
if __name__ == "__main__":
key_dir = os.path.join(os.getcwd(), "key.txt")
with open(key_dir, "w") as f:
f.write(uuid.uuid4().hex)
subprocess.check_call([sys.executable, "-m", "pip", "install", "pydantic"])
subprocess.check_call([sys.executable, "-m", "pip", "install", "llama-cpp-python"])
uvicorn.run("main:app", host="0.0.0.0", port=8912)