gokaygokay commited on
Commit
e7a1352
1 Parent(s): 7e0dcfc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -3,12 +3,13 @@ from lmdeploy.vl import load_image
3
  import spaces
4
  import gradio as gr
5
  from PIL import Image
 
6
 
7
-
8
 
9
  @spaces.GPU
10
  def create_captions_llava_llama3_docci(image):
11
- pipe = pipeline('gokaygokay/llava-llama3-docci')
12
  gen_config = GenerationConfig(repetition_penalty=1.10)
13
  image = Image.fromarray(np.uint8(image)).convert('RGB')
14
  response = pipe(('describe this image in detail', image), gen_config=gen_config)
@@ -33,7 +34,7 @@ with gr.Blocks(css=css) as demo:
33
  output = gr.Text(label="Caption")
34
 
35
  gr.Examples(
36
- [["assets/image1.png"], ["assets/image2.PNG"], ["assets/image3.jpg"]],
37
  inputs = [input_img],
38
  outputs = [output],
39
  fn=create_captions_llava_llama3_docci,
 
3
  import spaces
4
  import gradio as gr
5
  from PIL import Image
6
+ import numpy as np
7
 
8
+ pipe = pipeline('gokaygokay/llava-llama3-docci')
9
 
10
  @spaces.GPU
11
  def create_captions_llava_llama3_docci(image):
12
+
13
  gen_config = GenerationConfig(repetition_penalty=1.10)
14
  image = Image.fromarray(np.uint8(image)).convert('RGB')
15
  response = pipe(('describe this image in detail', image), gen_config=gen_config)
 
34
  output = gr.Text(label="Caption")
35
 
36
  gr.Examples(
37
+ [["image1.jpg"], ["image2.jpg"], ["image3.png"]],
38
  inputs = [input_img],
39
  outputs = [output],
40
  fn=create_captions_llava_llama3_docci,