adowu commited on
Commit
7d211df
·
verified ·
1 Parent(s): 8e47a66

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -21
main.py CHANGED
@@ -217,28 +217,9 @@ async def _call_with_retries(prompt: str, req: ChatCompletionRequest) -> str:
217
 
218
  async def _call_falcon_once(prompt: str, req: ChatCompletionRequest) -> str:
219
  client = await get_client()
220
- settings = {
221
- "model": req.model,
222
- "temperature": req.temperature,
223
- "max_new_tokens": req.max_tokens,
224
- "top_p": req.top_p,
225
- }
226
 
227
- # inicjalizacja nowego chatu z promptem (jeśli endpoint wymaga)
228
- await asyncio.to_thread(
229
- client.predict,
230
- prompt, # pierwszy argument podawany pozycyjnie
231
- settings_form_value=settings,
232
- api_name="/new_chat",
233
- )
234
-
235
- # dodanie wiadomości
236
- result = await asyncio.to_thread(
237
- client.predict,
238
- prompt, # pierwszy argument podawany pozycyjnie
239
- settings_form_value=settings,
240
- api_name="/add_message",
241
- )
242
 
243
  return _extract_text(result)
244
 
 
217
 
218
  async def _call_falcon_once(prompt: str, req: ChatCompletionRequest) -> str:
219
  client = await get_client()
 
 
 
 
 
 
220
 
221
+ # nowa wersja: wywołanie tylko z promptem, bez settings_form_value i /new_chat
222
+ result = await asyncio.to_thread(client.predict, prompt)
 
 
 
 
 
 
 
 
 
 
 
 
 
223
 
224
  return _extract_text(result)
225