arxivgpt kim commited on
Commit
26935f8
·
verified ·
1 Parent(s): 4e9a9f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -4,14 +4,13 @@ from gradio_client import Client
4
  def get_caption(image_in):
5
  client = Client("https://vikhyatk-moondream1.hf.space/")
6
  results = client.predict(
7
- image_in, # 'image_in'은 이미지 파일의 경로
8
- "Describe the image", # 'Describe the image'는 모델에 제출되는 고정 쿼리
9
  api_name="/answer_question"
10
  )
11
- # 결과 튜플에서 설명 텍스트만 추출하여 반환
12
- caption = results['data'][0]['text'] # API 응답의 구조에 따라 수정될 수 있음
13
- print(caption)
14
- return caption
15
 
16
  def get_lcm(prompt):
17
  client = Client("https://latent-consistency-lcm-lora-for-sdxl.hf.space/")
 
4
  def get_caption(image_in):
5
  client = Client("https://vikhyatk-moondream1.hf.space/")
6
  results = client.predict(
7
+ image_in,
8
+ "Describe the image",
9
  api_name="/answer_question"
10
  )
11
+ # API는 이미지에 대한 설명을 문자열로 바로 반환합니다.
12
+ print(results)
13
+ return results
 
14
 
15
  def get_lcm(prompt):
16
  client = Client("https://latent-consistency-lcm-lora-for-sdxl.hf.space/")