ALVHB95 commited on
Commit
c630f6a
·
1 Parent(s): d3abd97
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -31,7 +31,7 @@ from pydantic import BaseModel
31
  import shutil
32
 
33
  # Cell 1: Image Classification Model
34
- image_pipeline = pipeline(task="image-classification", model="rocioadlc/TrashNet_ResNet152V2")
35
 
36
  def predict_image(input_img):
37
  predictions = image_pipeline(input_img)
@@ -68,11 +68,10 @@ vectordb = Chroma.from_documents(
68
  persist_directory=persist_directory
69
  )
70
  # define retriever
71
- retriever = vectordb.as_retriever(search_type="mmr")
72
  prompt_template = """
73
  Your name is AngryGreta and you are a recycling chatbot with the objective to anwer questions from user in English or Spanish /
74
  Use the following pieces of context to answer the question if the question is related with recycling /
75
- No more than two chunks of context /
76
  Answer in the same language of the question /
77
  Always say "thanks for asking!" at the end of the answer /
78
  If the context is not relevant, please answer the question by using your own knowledge about the topic.
 
31
  import shutil
32
 
33
  # Cell 1: Image Classification Model
34
+ image_pipeline = pipeline(task="image-classification", model="rocioadlc/EfficientNetV2L_TFM")
35
 
36
  def predict_image(input_img):
37
  predictions = image_pipeline(input_img)
 
68
  persist_directory=persist_directory
69
  )
70
  # define retriever
71
+ retriever = vectordb.as_retriever(search_kwargs={"k": 1}, search_type="mmr")
72
  prompt_template = """
73
  Your name is AngryGreta and you are a recycling chatbot with the objective to anwer questions from user in English or Spanish /
74
  Use the following pieces of context to answer the question if the question is related with recycling /
 
75
  Answer in the same language of the question /
76
  Always say "thanks for asking!" at the end of the answer /
77
  If the context is not relevant, please answer the question by using your own knowledge about the topic.