prateekbh commited on
Commit
48030b2
1 Parent(s): f7085f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -51,7 +51,8 @@ def getProductDetails(history, image):
51
  product_description=getImageDescription(image)
52
  system_prompt="You're a helpful e-commerce marketing assitant working on art products."
53
  prompt="Our product description is as follows: " + product_description + ". Please write a product title options for it."
54
- interactWithModel(history, system_prompt, prompt)
 
55
 
56
  def interactWithModel(history, system_prompt, prompt):
57
  client = InferenceClient("google/gemma-7b-it")
@@ -73,6 +74,7 @@ def interactWithModel(history, system_prompt, prompt):
73
  output += response.token.text
74
  yield [(prompt, output)]
75
  history.append((prompt, output))
 
76
 
77
  @torch.no_grad()
78
  def getImageDescription(image):
 
51
  product_description=getImageDescription(image)
52
  system_prompt="You're a helpful e-commerce marketing assitant working on art products."
53
  prompt="Our product description is as follows: " + product_description + ". Please write a product title options for it."
54
+ return interactWithModel(history, system_prompt, prompt)
55
+
56
 
57
  def interactWithModel(history, system_prompt, prompt):
58
  client = InferenceClient("google/gemma-7b-it")
 
74
  output += response.token.text
75
  yield [(prompt, output)]
76
  history.append((prompt, output))
77
+ return history
78
 
79
  @torch.no_grad()
80
  def getImageDescription(image):