ALVHB95 commited on
Commit
57d1004
·
1 Parent(s): ccd5f83
Files changed (1) hide show
  1. app.py +5 -5
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="microsoft/resnet-50")
35
 
36
  def predict_image(input_img):
37
  predictions = image_pipeline(input_img)
@@ -39,9 +39,9 @@ def predict_image(input_img):
39
 
40
  image_gradio_app = gr.Interface(
41
  fn=predict_image,
42
- inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
43
  outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
44
- title="Hot Hot Dog? Or Not?",
45
  )
46
 
47
  # Cell 2: Chatbot Model
@@ -50,8 +50,8 @@ loader = PyPDFDirectoryLoader('pdfs')
50
  data=loader.load()
51
  # split documents
52
  text_splitter = RecursiveCharacterTextSplitter(
53
- chunk_size=700,
54
- chunk_overlap=100,
55
  length_function=len
56
  )
57
  docs = text_splitter.split_documents(data)
 
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)
 
39
 
40
  image_gradio_app = gr.Interface(
41
  fn=predict_image,
42
+ inputs=gr.Image(label="Select waste candidate", sources=['upload', 'webcam'], type="pil"),
43
  outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
44
+ title="What kind of waste do you have?",
45
  )
46
 
47
  # Cell 2: Chatbot Model
 
50
  data=loader.load()
51
  # split documents
52
  text_splitter = RecursiveCharacterTextSplitter(
53
+ chunk_size=500,
54
+ chunk_overlap=70,
55
  length_function=len
56
  )
57
  docs = text_splitter.split_documents(data)