Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ def health():
|
|
77 |
|
78 |
# Chat Completion API
|
79 |
@app.post("/chat/")
|
80 |
-
async def
|
81 |
try:
|
82 |
messages=[
|
83 |
{"role": "system", "content": gen.system},
|
@@ -114,18 +114,16 @@ async def complete(gen:GenModel):
|
|
114 |
|
115 |
# Chat Completion API
|
116 |
@app.get("/generate")
|
117 |
-
async def
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
seed: int = 42,
|
122 |
-
) -> dict:
|
123 |
try:
|
124 |
st = time()
|
125 |
output = llm_generate.create_chat_completion(
|
126 |
messages=[
|
127 |
-
{"role": "system", "content": system},
|
128 |
-
{"role": "user", "content": question},
|
129 |
],
|
130 |
temperature=temperature,
|
131 |
seed=seed,
|
|
|
77 |
|
78 |
# Chat Completion API
|
79 |
@app.post("/chat/")
|
80 |
+
async def chat(gen:GenModel):
|
81 |
try:
|
82 |
messages=[
|
83 |
{"role": "system", "content": gen.system},
|
|
|
114 |
|
115 |
# Chat Completion API
|
116 |
@app.get("/generate")
|
117 |
+
async def generate(gen:GenModel):
|
118 |
+
gen.system: str = "You are an AI assistant."
|
119 |
+
gen.temperature: float = 0.5
|
120 |
+
gen.seed: int = 42
|
|
|
|
|
121 |
try:
|
122 |
st = time()
|
123 |
output = llm_generate.create_chat_completion(
|
124 |
messages=[
|
125 |
+
{"role": "system", "content": gen.system},
|
126 |
+
{"role": "user", "content": gen.question},
|
127 |
],
|
128 |
temperature=temperature,
|
129 |
seed=seed,
|