Update app.py
Browse files
app.py
CHANGED
@@ -70,6 +70,7 @@ async def chat(gen:GenModel):
|
|
70 |
try:
|
71 |
messages=[
|
72 |
{"role": "assistant", "content": gen.system},
|
|
|
73 |
]
|
74 |
st = time()
|
75 |
|
@@ -80,11 +81,10 @@ async def chat(gen:GenModel):
|
|
80 |
seed=gen.seed,
|
81 |
#stream=True
|
82 |
)
|
83 |
-
#
|
84 |
-
print(output)
|
85 |
et = time()
|
86 |
output["time"] = et - st
|
87 |
-
messages.append({'role': "assistant", "content": output['choices'][0]['message']['content']})
|
88 |
#print(messages)
|
89 |
return output
|
90 |
except Exception as e:
|
@@ -104,7 +104,7 @@ async def generate(gen:GenModel):
|
|
104 |
output = llm_generate.create_chat_completion(
|
105 |
messages=[
|
106 |
{"role": "system", "content": gen.system},
|
107 |
-
|
108 |
],
|
109 |
temperature = gen.temperature,
|
110 |
seed= gen.seed,
|
|
|
70 |
try:
|
71 |
messages=[
|
72 |
{"role": "assistant", "content": gen.system},
|
73 |
+
**gen.question
|
74 |
]
|
75 |
st = time()
|
76 |
|
|
|
81 |
seed=gen.seed,
|
82 |
#stream=True
|
83 |
)
|
84 |
+
#print(output)
|
|
|
85 |
et = time()
|
86 |
output["time"] = et - st
|
87 |
+
#messages.append({'role': "assistant", "content": output['choices'][0]['message']['content']})
|
88 |
#print(messages)
|
89 |
return output
|
90 |
except Exception as e:
|
|
|
104 |
output = llm_generate.create_chat_completion(
|
105 |
messages=[
|
106 |
{"role": "system", "content": gen.system},
|
107 |
+
{"role": "user", "content": gen.question},
|
108 |
],
|
109 |
temperature = gen.temperature,
|
110 |
seed= gen.seed,
|