Spaces:
Runtime error
Runtime error
ZeroGPU
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import argparse
|
2 |
import torch
|
3 |
import re
|
@@ -20,6 +21,7 @@ moondream = AutoModelForCausalLM.from_pretrained(
|
|
20 |
moondream.eval()
|
21 |
|
22 |
|
|
|
23 |
def answer_question(img, prompt):
|
24 |
image_embeds = moondream.encode_image(img)
|
25 |
streamer = TextIteratorStreamer(tokenizer, skip_special_tokens=True)
|
|
|
1 |
+
import spaces
|
2 |
import argparse
|
3 |
import torch
|
4 |
import re
|
|
|
21 |
moondream.eval()
|
22 |
|
23 |
|
24 |
+
@spaces.GPU(duration=10)
|
25 |
def answer_question(img, prompt):
|
26 |
image_embeds = moondream.encode_image(img)
|
27 |
streamer = TextIteratorStreamer(tokenizer, skip_special_tokens=True)
|