Asya2025 commited on
Commit
be6ef46
·
verified ·
1 Parent(s): d216507

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -1,22 +1,19 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- # Загружаем модель
5
  pipe = pipeline("image-to-text", model="deepseek-ai/DeepSeek-VL2-Small")
6
 
7
  def predict(image):
8
  result = pipe(image)
9
  return result[0]['generated_text'] if isinstance(result, list) else result
10
 
11
- # Интерфейс для ввода картинки
12
  iface = gr.Interface(
13
  fn=predict,
14
  inputs=gr.Image(type="pil"),
15
  outputs="text",
16
  title="DeepSeek Image-to-Text Generator",
17
- description="Генерация описания по изображению через DeepSeek-VL2-Small"
18
  )
19
 
20
- # Запуск
21
  if __name__ == "__main__":
22
  iface.launch()
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
 
4
  pipe = pipeline("image-to-text", model="deepseek-ai/DeepSeek-VL2-Small")
5
 
6
  def predict(image):
7
  result = pipe(image)
8
  return result[0]['generated_text'] if isinstance(result, list) else result
9
 
 
10
  iface = gr.Interface(
11
  fn=predict,
12
  inputs=gr.Image(type="pil"),
13
  outputs="text",
14
  title="DeepSeek Image-to-Text Generator",
15
+ description="Описание изображений через DeepSeek-VL2-Small"
16
  )
17
 
 
18
  if __name__ == "__main__":
19
  iface.launch()