Add Python server setup and dependencies installation
This commit is contained in:
@@ -2,10 +2,15 @@ from fastapi import FastAPI, Header
|
||||
from fastapi.responses import StreamingResponse
|
||||
from llamacpp import LlamaItem, stream_chat_llamacpp
|
||||
from typing import Annotated, Union
|
||||
import uuid
|
||||
import os
|
||||
|
||||
app = FastAPI()
|
||||
key_dir = os.path.join(os.getcwd(), "key.txt")
|
||||
if not os.path.exists(key_dir):
|
||||
f = open(key_dir, 'w')
|
||||
f.write(str(uuid.uuid4()))
|
||||
f.close()
|
||||
f = open(key_dir, 'r')
|
||||
key = f.read()
|
||||
f.close()
|
||||
|
||||
Reference in New Issue
Block a user