Update app/llm.py
Browse files- app/llm.py +4 -4
app/llm.py
CHANGED
|
@@ -114,9 +114,9 @@ async def generate(gen:GenModel):#, user: schemas.BaseUser = fastapi.Depends(cur
|
|
| 114 |
seed= gen.seed,
|
| 115 |
#chat_format="llama-2",
|
| 116 |
stream=True,
|
| 117 |
-
|
| 118 |
)
|
| 119 |
-
|
| 120 |
for chunk in output:
|
| 121 |
delta = chunk['choices'][0]['delta']
|
| 122 |
if 'role' in delta:
|
|
@@ -124,10 +124,10 @@ async def generate(gen:GenModel):#, user: schemas.BaseUser = fastapi.Depends(cur
|
|
| 124 |
elif 'content' in delta:
|
| 125 |
print(delta['content'], end='')
|
| 126 |
#print(chunk)
|
| 127 |
-
|
| 128 |
et = time()
|
| 129 |
output["time"] = et - st
|
| 130 |
-
|
| 131 |
except Exception as e:
|
| 132 |
logger.error(f"Error in /generate endpoint: {e}")
|
| 133 |
return JSONResponse(
|
|
|
|
| 114 |
seed= gen.seed,
|
| 115 |
#chat_format="llama-2",
|
| 116 |
stream=True,
|
| 117 |
+
echo = not True
|
| 118 |
)
|
| 119 |
+
|
| 120 |
for chunk in output:
|
| 121 |
delta = chunk['choices'][0]['delta']
|
| 122 |
if 'role' in delta:
|
|
|
|
| 124 |
elif 'content' in delta:
|
| 125 |
print(delta['content'], end='')
|
| 126 |
#print(chunk)
|
| 127 |
+
|
| 128 |
et = time()
|
| 129 |
output["time"] = et - st
|
| 130 |
+
print(output)
|
| 131 |
except Exception as e:
|
| 132 |
logger.error(f"Error in /generate endpoint: {e}")
|
| 133 |
return JSONResponse(
|