Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -299,13 +299,24 @@ KEYWORD LIST:
|
|
299 |
|
300 |
def get_mem(prompt,kw):
|
301 |
seed=random.randint(1,1000000000)
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
|
|
|
|
|
|
|
|
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 |
|