Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -401,7 +401,31 @@ def create_memory(model_name='gpt-3.5-turbo',memory_max_token=None):
|
|
401 |
)
|
402 |
return memory
|
403 |
|
404 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
|
406 |
standalone_question_template = """Given the following conversation and a follow up question,
|
407 |
rephrase the follow up question to be a standalone question, in its original language.\n\n
|
|
|
401 |
)
|
402 |
return memory
|
403 |
|
404 |
+
# Set a small memory_max_token, just to show how older messages are summarized if max_token_limit is exceeded.
|
405 |
+
|
406 |
+
memory = create_memory(model_name='gpt-3.5-turbo',memory_max_token=20)
|
407 |
+
|
408 |
+
# save context
|
409 |
+
memory.save_context(
|
410 |
+
inputs={"question":"what does DTC stand for?"},
|
411 |
+
outputs={"answer":"""Diffuse to Choose (DTC) is a novel diffusion inpainting approach designed for the Vit-All application,
|
412 |
+
which allows users to virtually place any e-commerce item in any setting, ensuring detailed, semantically coherent blending with realistic
|
413 |
+
lighting and shadows. It effectively incorporates fine-grained cues from the reference image into the main U-Net decoder
|
414 |
+
using a secondary U-Net encoder.
|
415 |
+
DTC can handle a variety of e-commerce products and can generate images using in-the-wild images & references.
|
416 |
+
It is superior to existing zero-shot personalization methods, especially in preserving the fine-grained details of items."""}
|
417 |
+
)
|
418 |
+
memory.save_context(
|
419 |
+
inputs={"question":"what does Vit-all stand for?"},
|
420 |
+
outputs={"answer":"Virtual Try-All"}
|
421 |
+
)
|
422 |
+
|
423 |
+
memory.load_memory_variables({})
|
424 |
+
|
425 |
+
|
426 |
+
|
427 |
+
|
428 |
+
|
429 |
|
430 |
standalone_question_template = """Given the following conversation and a follow up question,
|
431 |
rephrase the follow up question to be a standalone question, in its original language.\n\n
|