Staticaliza commited on
Commit
32f0fe9
1 Parent(s): e7322bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -33,13 +33,15 @@ def generate(image, video, instruction=DEFAULT_INPUT, sampling=False, temperatur
33
 
34
  print(image)
35
  print(video)
36
- print(not video)
37
 
38
- image_data = Image.fromarray(image.astype('uint8'), 'RGB')
39
- print(image_data, instruction)
40
-
41
- inputs = [{"role": "user", "content": [image_data, instruction]}]
42
 
 
 
 
 
43
  parameters = {
44
  "sampling": sampling,
45
  "temperature": temperature,
@@ -50,7 +52,9 @@ def generate(image, video, instruction=DEFAULT_INPUT, sampling=False, temperatur
50
  }
51
 
52
  output = repo.chat(image=None, msgs=inputs, tokenizer=tokenizer, **parameters)
 
53
  print(output)
 
54
  return output
55
 
56
  def cloud():
@@ -63,7 +67,7 @@ with gr.Blocks(css=css) as main:
63
 
64
  with gr.Column():
65
  input = gr.Image(label="Image")
66
- input_2 = gr.Image(label="Video")
67
  instruction = gr.Textbox(lines=1, value=DEFAULT_INPUT, label="Instruction")
68
  sampling = gr.Checkbox(value=False, label="Sampling")
69
  temperature = gr.Slider(minimum=0.01, maximum=1.99, step=0.01, value=0.7, label="Temperature")
 
33
 
34
  print(image)
35
  print(video)
 
36
 
37
+ if not video:
38
+ image_data = Image.fromarray(image.astype('uint8'), 'RGB')
39
+ print(image_data, instruction)
 
40
 
41
+ inputs = [{"role": "user", "content": [image_data, instruction]}]
42
+ else:
43
+ priny("video")
44
+
45
  parameters = {
46
  "sampling": sampling,
47
  "temperature": temperature,
 
52
  }
53
 
54
  output = repo.chat(image=None, msgs=inputs, tokenizer=tokenizer, **parameters)
55
+
56
  print(output)
57
+
58
  return output
59
 
60
  def cloud():
 
67
 
68
  with gr.Column():
69
  input = gr.Image(label="Image")
70
+ input_2 = gr.Video(label="Video")
71
  instruction = gr.Textbox(lines=1, value=DEFAULT_INPUT, label="Instruction")
72
  sampling = gr.Checkbox(value=False, label="Sampling")
73
  temperature = gr.Slider(minimum=0.01, maximum=1.99, step=0.01, value=0.7, label="Temperature")