VinitT commited on
Commit
7c3671a
·
verified ·
1 Parent(s): fccc5c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -36,6 +36,10 @@ if uploaded_file is not None:
36
  messages, tokenize=False, add_generation_prompt=True
37
  )
38
 
 
 
 
 
39
  # Pass the image to the processor
40
  inputs = processor(
41
  text=[text],
@@ -45,6 +49,10 @@ if uploaded_file is not None:
45
  )
46
  inputs = inputs.to("cpu")
47
 
 
 
 
 
48
  # Inference: Generation of the output
49
  generated_ids = model.generate(**inputs, max_new_tokens=128)
50
  generated_ids_trimmed = [
@@ -54,5 +62,9 @@ if uploaded_file is not None:
54
  generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
55
  )
56
 
 
 
 
 
57
  st.write("Description:")
58
- st.write(output_text)
 
36
  messages, tokenize=False, add_generation_prompt=True
37
  )
38
 
39
+ # Debugging: Display the generated text
40
+ st.write("Generated text for processing:")
41
+ st.write(text)
42
+
43
  # Pass the image to the processor
44
  inputs = processor(
45
  text=[text],
 
49
  )
50
  inputs = inputs.to("cpu")
51
 
52
+ # Debugging: Display the inputs
53
+ st.write("Inputs for the model:")
54
+ st.write(inputs)
55
+
56
  # Inference: Generation of the output
57
  generated_ids = model.generate(**inputs, max_new_tokens=128)
58
  generated_ids_trimmed = [
 
62
  generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
63
  )
64
 
65
+ # Debugging: Display the raw output text
66
+ st.write("Raw output text:")
67
+ st.write(output_text)
68
+
69
  st.write("Description:")
70
+ st.write(output_text[0])