vikhyatk commited on
Commit
2c6d54d
·
verified ·
1 Parent(s): 29df513

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,4 +1,4 @@
1
- REVISION = "02ddf9ce6f292965305f578ab7d070e59b24d0b1"
2
 
3
  try:
4
  import spaces
@@ -149,7 +149,13 @@ def caption(img, mode):
149
  return
150
 
151
  buffer = ""
152
- for t in moondream.caption(img, length="short" if mode == "Short" else "normal", stream=True)["caption"]:
 
 
 
 
 
 
153
  buffer += t
154
  yield buffer.strip()
155
 
 
1
+ REVISION = "c2bcd8ac7d7dabbbd84f0176f6886395577625de"
2
 
3
  try:
4
  import spaces
 
149
  return
150
 
151
  buffer = ""
152
+ if mode == "Short":
153
+ l = "short"
154
+ elif mode == "Long":
155
+ l = "long"
156
+ else:
157
+ l = "normal"
158
+ for t in moondream.caption(img, length=l, stream=True)["caption"]:
159
  buffer += t
160
  yield buffer.strip()
161