moriire commited on
Commit
08499cc
1 Parent(s): 609ebbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -77,7 +77,7 @@ def health():
77
 
78
  # Chat Completion API
79
  @app.post("/chat/")
80
- async def complete(gen:GenModel):
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 complete(
118
- question: str,
119
- system: str = "You are an AI assistant.",
120
- temperature: float = 0.7,
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,