Omnibus commited on
Commit
fe1f3ac
·
verified ·
1 Parent(s): 1451d05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -5
app.py CHANGED
@@ -299,13 +299,24 @@ KEYWORD LIST:
299
 
300
  def get_mem(prompt,kw):
301
  seed=random.randint(1,1000000000)
302
- resp = run_gpt(
303
- RECALL_MEMORY.format(keywords=kw,prompt=prompt),
304
- stop_tokens=[],
305
- max_tokens=1024,
 
 
 
 
306
  seed=seed,
307
  )
308
-
 
 
 
 
 
 
 
309
  print (resp)
310
  return resp
311
 
 
299
 
300
  def get_mem(prompt,kw):
301
  seed=random.randint(1,1000000000)
302
+
303
+
304
+ generate_kwargs = dict(
305
+ temperature=0.9,
306
+ max_new_tokens=1024,
307
+ top_p=0.95,
308
+ repetition_penalty=1.0,
309
+ do_sample=True,
310
  seed=seed,
311
  )
312
+
313
+ content = RECALL_MEMORY.format(keywords=kw,prompt=prompt),
314
+
315
+ stream = client.text_generation(content, **generate_kwargs, stream=True, details=True, return_full_text=False)
316
+ resp = ""
317
+ for response in stream:
318
+ resp += response.token.text
319
+
320
  print (resp)
321
  return resp
322