jonathanjordan21 commited on
Commit
aa6eacc
·
1 Parent(s): fd5c436

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -15,11 +15,8 @@ processor = DonutProcessor.from_pretrained("jonathanjordan21/donut_fine_tuning_f
15
  # Load model
16
  model = VisionEncoderDecoderModel.from_pretrained("jonathanjordan21/donut_fine_tuning_food_composition_id")
17
 
18
-
19
- def predict(inp):
20
-
21
- # Define Json Parser
22
- def get_komposisi(image_path, image=None):
23
  image = Image.open(image_path).convert('RGB') if image== None else image.convert('RGB')
24
 
25
  task_prompt = "<s_kmpsi>"
@@ -45,6 +42,8 @@ def predict(inp):
45
 
46
  return processor.token2json(sequence3)
47
 
 
 
48
  #Generate Output
49
  out = get_komposisi("", inp)
50
  return out
 
15
  # Load model
16
  model = VisionEncoderDecoderModel.from_pretrained("jonathanjordan21/donut_fine_tuning_food_composition_id")
17
 
18
+ # Define Json Parser
19
+ def get_komposisi(image_path, image=None):
 
 
 
20
  image = Image.open(image_path).convert('RGB') if image== None else image.convert('RGB')
21
 
22
  task_prompt = "<s_kmpsi>"
 
42
 
43
  return processor.token2json(sequence3)
44
 
45
+
46
+ def predict(inp):
47
  #Generate Output
48
  out = get_komposisi("", inp)
49
  return out